Semantic

Semantic summary

Semantic Overview :

 

What is semantic:

 

HTML in different elements represent different meanings;

Using the element having a meaning to write HTML document, i.e. semantics;

Write HTML document the most important, that is, different content to choose the right elements;

Semantic belongs HTML visible, regardless of the style;

Currently, HTML newest version is HTML5 , the introduction of more semantic elements.

 

Semantic role:

 

Conducive browser to understand HTML document;

<strong>

Important, the browser in the reading mode should not ignore the content;

If the browser has a voice reading function, you should re-read the contents of the elements;

<i>

If the browser has a voice reading function, you should use a special tone to read the content of the element;

Conducive to search engines to understand HTML document

Baidu, Google, Bing , etc.

Internet search engines to access the page, the search engine will read these pages of HTML code that will help better semantic search engines understand the meaning of each piece of content pages help to improve the site's ranking.

 

HTML5 element table:

 

HTML5 element table lists the various elements, and the color classification of the same color is classified as a class.

 

Hyperlink:

 

Hyperlinks <a> elements

After clicking a hyperlink will jump to another page;

<a> elements of writing format:

<a href=" "> target content </a>

<a target=" 页面打开位置"href=" "> target content </a>

href attribute:

Page address ( path ) ,

Anchor,

Featured links;

 

target attribute:

_blank opens in new window,

_self default value, the current window is opened;

 

Absolute and relative paths:

 

Absolute path:

 

When the site is deployed to the server, all the resources are available through the Web site address ( path ) access.

The address ( path ) written in the format: protocol : // domain name / directory

Example: http://www.google.com/

Protocols: HTTP

Domain Name: www.google.com

Directory: root directory

Example: http://meyerweb.com/eric/tools/css/reset/reset.css

Protocols: HTTP

Domain Name: meyerweb.com

Directory: root directory /eric/tools/css/reset/reset.css

Written formats path, called the absolute path.

Absolute path usage scenarios:

When accessing resources outside the station, only use absolute paths;

Access to resources within the station, if the site has been deployed to the server, you can use an absolute path, and can be omitted protocol and domain name.

 

relative path:

 

Path is relative to the current location of the resource, only for the access station resource;

The format of a relative path is:

./ path

Represents the current directory resource is located, must be started as a relative path, may be omitted;

../

It represents the return to the parent directory;

 

Comprehensive Example:

 

<link rel="stylesheet" href="/css/main.css">

Absolute path (omitted protocol and domain name)

<link rel="stylesheet" href="css/main.css">

Relative path (omitted ./ )

<a href="http://www.google.com/">...</a>

Absolute path

<a href="../u/account/login.html">...</a>

Relative path (omitted ./ )

<a href="/u/account/login.html">...</a>

Absolute path (omitted protocol and domain name)

<a href="u/account/login.html">...</a>

Relative path (omitted ./ )

<a href="./u/account/login.html">...</a>

relative path

 

Outside the station resources: absolute path

Site Resources: absolute path (the site has been deployed, can be omitted protocol and domain name), a relative path

 

 

Text elements:

 

h1 of ~ H6 : . 1 level headings 1-6 level heading

p: paragraph

blockquote : reference to the whole of

auf cite : reference references

q: small pieces of text references

abbr : a reference to the acronyms

strong : important text

EM : emphasized text

b: should highlight the text to be displayed

i: should be treated differently in the text

 

Structural elements:

 

div elements:

 

It is a very common element, it has no semantics, it represents only a container for containing other elements in the layout of the site, which is usually used to represent the area of ​​the page.

 

Entity characters:

 

The format of character entities are: & entity name ; or & # entity number ;

Common solid character:

Space: Entity Name  Entity Number 

Less-than sign (<): the entity name < Entity Number < ;

Greater than symbol (>): entity name > Entity Number > ;

And the sign ( & ): the entity name & entity number & ;

Copyright symbol ( @ ): the entity name © entity number © ;

 

Guess you like

Origin www.cnblogs.com/zai1/p/10974091.html