Parsing HTML language (v) font marking

Source: Internet
Author: User
Tags comparison header relative

Parsing HTML language

Font marks

<STRONG> <B>
<I> <EM> <VAR> <CITE> <DFN> <ADDRESS>
<TT> <SAMP> <CODE> <KBD> <U> <STRIKE> <BIG> <SMALL> <SUP> <sub >
<H1> <H2> <H3> <H4> <H5> <H6>
<FONT> <BASEFONT>
Entity tags and logical tags: ▲top

In this section, "Font marks" you have to understand the difference between the entity tag and the logical tag, otherwise you will be puzzled as to why different tags have the same effect. The two have the following two places respectively:
Entity tags have a fixed display effect, and logical tags vary according to different browsers.
For example, the <EM> of a logical tag because of the different browsers it does not necessarily appear italic effect, it may be the bottom line, bold or anti-white, so this section is based on their effects in IE and NC introduced.

Multiple entity tags can also effectively indicate the same sentence, and logical tags are usually not effective in the old browser display multiple indicators.
For example, two logical tags <EM> and <STRONG> at the same time mark a word in the old browser often lose its effect.

Entity tags are:
<I> <B> <U>
Logical tags are:
<STRONG> <EM> <VAR> <CITE> <DFN > <ADDRESS> <CODE> <KBO> <SAMP> <TT>
If the actual effect is required, the entity mark is preferable.
 
<STRONG> <B>:                                           ▲top
 
Both produce a font bold effect, However, it is important to note that when the file is set to gb2312 Encoding, the Chinese characters shown in both will not display bold effects in Netscape netvigator.

Example: (the first line is without any font marks, for comparison purposes)
HTML Source Code (original code)                    Browser Display Results
creation of webpage                            Creation of webpage    
<br><strong>creation of webpage</strong>      creation of webpage
<br><b>creation of webpage</b>                Creation of webpage

<I> <EM> <VAR> <CITE> <DFN> <address>:▲top

These tags in Internet Explorer all have italic effects, and only </DFN> has lost its role in Netscape Netvigator. Only <ADDRESS> in these tags is special, because it includes the wrapping effect so you don't have to precede it with a <BR> tag.
Example:

HTML Source Code (source code) browser displays results
<i>creation of webpage</i> creation of webpage
<br><em>creation of webpage</em> creation of webpage
<br><var>creation of webpage</var> creation of webpage
<br><cite>creation of webpage</cite> creation of webpage
<br><dfn>creation of webpage</dfn> creation of webpage
<address>creation of webpage</address> creation of webpage

<TT> <SAMP> <CODE> <KBD> <U> <STRIKE> <BIG> <SMALL> <SUP> < Sub>▲top

To facilitate control and token, the 10 tags are introduced together.
<TT> <SAMP> <CODE> <KBD> allows each letter to have an equal width and a slight widening of the distance between each letter. But that's not necessarily true of NC.
<U> is the bottom line of the tag, some special browsers do not support, because of concern with the link confusion.
<STRIKE> Plus strikethrough markings.
<BIG> make fonts larger.
<SMALL> makes the font thinner.
<SUB> for subscript, <SUP> for superscript, only mathematical mark left.
Example: (The first line is without any font marks, for comparison purposes)

HTML Source Code (source code) browser displays results
Creation of webpage creation of webpage
<br><tt>creation of webpage</tt> creation of webpage
<br><samp>creation of webpage</samp> creation of webpage
<br><code>creation of webpage</code> creation of webpage
<br><kbd>creation of webpage</kbd> creation of webpage
<br><u>creation of webpage</u> creation of webpage
<br><strike>creation of webpage</strike> creation of webpage
<br><big>creation of webpage</big> creation of webpage
<br><small>creation of webpage</small> creation of webpage
<br>12345<SUB>7</SUB> 6789<sup>9</sup> 123457 67899

<H1> <H2> <H3> <H4> <H5>
These are title tags, and the degree of widening widened from <H1> to <H6> gradually decreases. Each title tag is marked with a single line and a blank row left and right.
Example: Source code
Show results
Header Level 1
Header Level 2
Header Level 3
Header Level 4
Header Level 5
Header Level 6

<FONT> <basefont>:▲top

In this section, only the two tags have parameters set, and the parameters are set to the same, are responsible for setting the text size, style and color, but each useful, and look at the following comparison:
<BASEFONT> can be used at the beginning of a file, that is, the position between <HEAD> and </HEAD>, which affects the full text, and is an empty tag to change the default value of the font display.
<FONT> is applied to the text part of the document, that is, the position between <BODY> and </BODY>, which only affects the words indicated, is a containment mark.
The two marks can exist at the same time, only not by the words marked by <FONT> directly accept <BASEFONT> influence, and <FONT> itself is affected by <BASEFONT>.
<FONT> parameter setting:
Example: <font face= "Arial" size= "+2" color= "#008000" >creation of webpage</font>

Face= "Arial"
Sets the font style of the text. Arial is a common type, please do not use glyphs other than the Window's built-in glyphs. Netscape Netvigator does not display any Chinese glyphs specified in this tag in a Chinese page that is not set to Gb2312 Encoding.
Size= "+2"
Sets the size of the text. The value can be absolute or relative,
The absolute meaning is to mark oneself determines the size of the text, not affected by <BASEFONT>, such as
Size= "5" means that the size is 5, and the HTML default is 3, that is, size= "3" is the same as not set.
The relative meaning is to increase or reduce the size series on the basis of the default value of 3, such as size= "+2" is equivalent to the absolute representation of size= "5", but if the <basefont size= "n" > then its actual defecation is n+2 is no longer 3+2. <BASEFONT> there is only absolute notation.
Color= "#008000"
Sets the color of the text. #008000 means Green
Example:
Original code
<font size= "+1" >i Love creation of webpage</font>
<br><font size= "+2" color= "#800080" >i Love creation of webpage</font>
<br><font face= "Times New Roman" size= "5" color= "#008000" >i Love creation of webpage</font>
Show results
I Love creation of webpage
I Love creation of webpage
I Love creation of webpage



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.