HTML thorough parsing (5) Font marking

Source: Internet
Author: User
Tags empty end header i18n reference relative

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>

To understand this "HTML thorough analysis" of the mark classification, please see " Mark List ".
Please also understand the distinction between containment and empty tags, see "HTML concept ."

 
entity tag and logical tag: ▲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:

1, the entity tag has a fixed display effect, the logical tag is different depending on the browser.

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.

2, Multiple entity tags can also effectively indicate the same sentence, logical tags are usually not effective 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>
  • The logical tags are:
    <STRONG> <EM> <VAR> <CITE> <DFN> <ADDRESS> <CODE> <KBO> <SAMP> <TT>

If the actual effect of the request is of course marked as good entity.

 
<STRONG> <B>: ▲top

<B>...</B>
Usage: Make text appear in bold
Start/End Identification: must/must
Properties:%coreattrs,%i18n,%events
Null: Not Allowed

Both can produce a bold font effect, but it must be noted that when the file encoding is set to Chinese characters, the Chinese characters marked by both will not show the bold effect in Netscape netvigator.

Example: (The first line is not any font marks, for reference)

HTML source Code (original) Browser Display Results
Creation of webpage
<br><strong>creation of Webpage</strong>
<br><b>creation of Webpage</b>
Creation of webpage
Creation of webpage
Creation of webpage

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

<I>...</I>
Usage: Make text appear in italics
Start/End Identification: must/must
Properties:%coreattrs,%i18n,%events
Null: Not Allowed

These tags have italic effects in Internet Explorer, and only </DFN> is out of effect by 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 (original) Browser Display Results
<i>creation of Webpage</i>
<br><em>creation of Webpage</em>
<br><var>creation of Webpage</var>
<br><cite>creation of Webpage</cite>
<br><dfn>creation of Webpage</dfn>
<address>creation of Webpage</address>
Creation of webpage
Creation of webpage
Creation of Webpage
Creation of Webpage
Creation of Webpage 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> gives each letter an equal width and a slightly wider 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 the 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 not any font marks, for reference)

HTML source Code (original) Browser Display Results
Creation of webpage
<br><tt>creation of Webpage</tt>
<br><samp>creation of Webpage</samp>
<br><code>creation of Webpage</code>
<br><kbd>creation of Webpage</kbd>
<br><u>creation of Webpage</u>
<br><strike>creation of Webpage</strike>
<br><big>creation of Webpage</big>
<br><small>creation of Webpage</small>
<br>12345<SUB>7</SUB> 6789<sup>9</sup>
Creation of webpage
Creation of webpage
Creation of Webpage
Creation of Webpage
Creation of Webpage
Creation of Webpage
Creation of Webpage
Creation of Webpage
Creation of Webpage
123457 67899

 
<H1> <H2> <H3> <H4> <H5> ▲top

These tags are title tags, which are gradually smaller from <H1> to <H6>. Each title tag is marked with a single line and a blank row left and right.

Example:

Original code
Show results

Header Level 1

Header Level 2

Header Level 3

Header Level 4

Header Level 5

Header Level 6

 
<FONT> <basefont>: ▲top

<FONT>...</FONT>
Usage: To change font size and color
Start/End Identification: must/must
Properties: Size= "..." Text font size (from 1 to 7, or similar numbers)
Color= "..." Text font color
Face= "..." Text font type
Null: Not Allowed
Note: It is better to use style sheets to implement this setting, advocating the use of style sheets

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, font and color, but each useful, and look at the following comparison:

    • <BASEFONT> can be used at the beginning of the file, that is, the position between <HEAD> and </HEAD>, which will affect the full text, 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.
    • Two markers 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 a font other than the Window with fonts. For Chinese pages that are not set to Chinese code, Netscape Netvigator will not display any Chinese fonts specified in this tag. The
    • size = "+2"
      Sets the size of the text. The value can be absolute or ,
      the absolute meaning is to mark oneself determines the size of the text, not by the <basefont > Scratch 欤 ? The
      size= "5 " indicates that its size is 5 , while the HTML default value is 3, that is, size= "3 is the same as not set. The
      relative meaning is a series that increases or shrinks on the basis of the default value of 3, such as size= "+2 ", which equals absolute notation size= "5" , Blue Sky If set <basefont size= "n " > Its actual defecation is n+2 No longer is 3+2 . <BASEFONT> there is only absolute notation. The
    • color = "#008000"
      Sets the color of the text. #008000 for green, various color values and tinting method please refer to " tinting principle The

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& gt;
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.