Home > Web Front-end > CSS Tutorial > Layout pages with interesting custom tags_Experience exchange

Layout pages with interesting custom tags_Experience exchange

WBOY
Release: 2016-05-16 12:10:20
Original
2538 people have browsed it

Today we will learn how to use interesting custom tags to layout pages. Some friends may have this question, how can the browser correctly recognize the tags that they have defined casually?

Here we will use the namespace of the document, so what does the namespace refer to?

Everyone knows that one of the great features of XML is its scalability. You can create your own tags or use tags created by others. There is a problem here, that is, the tags you define

may be the same as those defined by others, but they each represent the same meaning. But different.

To give an analogy, for example, there are two people named Blue, one is in Classic and the other is in Tianya. If you want to find them, you can explain it like this, Tianya: Blue, Classic: Blue color so there is no confusion.

The meaning of the namespace is to tell others who this document belongs to. xhtml is the product of the transition from html to xml, and it also provides us with a namespace here.

Look at the example below, we name a prefix named blueidea, http://bbs.blueidea.com is the url used to describe the namespace. xmlns refers to xhtml namespace

Copy code The code is as follows:

Interestingly, we can even use Chinese for markup (there may be encoding problems in Chinese). Such a document looks really self-explanatory.

Below we define a tag called "news title" format which should be "blueidea: news title"

Copy code The code is as follows:
latest updatetitle>
Then define it with CSS, format:


blueidea: News title {

}
要注意的是我們自訂的標記預設屬性,有點象a、span等內嵌元素。

下面是我寫的一個基本佈局,(兼容IE5、6、7 FF2 OP9)是不是很有意思,象XML,其實本來自訂標記就是用在xml上地。大家趕緊自己來試試吧,因為很多東西都是自己從實踐中摸索出來的。

[Ctrl+A 全選 註:如需引入外部Js需刷新才能執行]
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template