Analysis of basic grammar and semantic writing rules and examples of HTML

小云云
Release: 2017-12-26 09:44:03
Original
1867 people have browsed it

This article mainly shares with you the organization and examples of the basic syntax and semantics of HTML. Friends who need it can refer to it. I hope it can help everyone.

DOCTYPE

DOCTYPE(Document Type)

This declaration is located at the frontmost position in the document, before the html tag. This tag tells the browser Which HTML or XHTML specification the document uses.

DTD(Document Type Definition)

The declaration starts with, it is not case sensitive, there is no content in front, if Having other content (except spaces) will cause the browser to turn on quirks mode in IE to render web pages. PublicDTD, the name format is registration // organization // type tag // language, registration refers to whether the organization is registered by the International Organization for Standardization (ISO), + means yes, - means no. Organization is the name of the organization, such as:W3C. The type is usually DTD. A tag specifies a description of the public text, that is, a unique descriptive name for the referenced public text, which can be followed by a version number. The last language is theISO 639language identifier of the DTD language, such as: EN means English, ZH means Chinese. XHTML 1.0 can declare three DTD types. Representsstrict version, transitional version, and framework-based HTML documentrespectively.

HTML 4.01 strict

HTML 4.01 Transitional

HTML 4.01 Frameset

HTML5 Document Type

meta

Declare the character encoding used in the document

Before html5


 html5 
Copy after login

SEO Optimization

Title

your title

Page description

Keywords

Web author

Web search engine indexing method

follow Follow the link and analyze the target page. This is the default behavior and can be ignored.

index Index the web page. This is the default behavior and can be ignored.

noodp does not use the Open Directory Project to create content descriptions.

noydir does not use Yahoo Directory to create content descriptions.

noarchive does not allow search engines to display cached versions of content.

cache allows search engines to display cached versions of content.

Nocache does not allow search engines to display cached versions of content.

Tags

define the structure of the document and make the markup of the document more semantic.


html5 demo     html5 demo 

html5 demo

article aside

article
footer
Copy after login

tips

html5 tag is more abundant and complete, the p tag seems to have no use, but if you just want to Add a section of style to the document. This is when the p tag comes in handy. The default style of the

tag will be different in different browsers. In order for a web page to have the same effect in different browsers, it is usually necessary to format the tag style first


@charset "utf-8"; html{margin:0;padding:0;border:0}a,abbr,acronym,address,article,aside,blockquote,body,caption,code,dd,del,dfn,dialog,p,dl,dt,em,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,iframe,img,label,legend,li,nav,object,ol,p,pre,q,section,span,table,tbody,td,tfoot,th,thead,tr,ul{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,dialog,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1.5;background:#fff}table{border-collapse:separate;border-spacing:0}caption,td,th{text-align:left;font-weight:400;float:none!important}table,td,th{vertical-align:middle}blockquote:after,blockquote:before,q:after,q:before{content:''}blockquote,q{quotes:"" ""}a img{border:none}a{text-decoration:none}:focus{outline:0}
Copy after login

If you want to use the html5 tag in a browser that does not support html5, you need to add a small piece of JavaScript code


Copy after login

The label editable attribute contenteditable

Related recommendations:

Analysis of HTML basic syntax and semantic writing rules

The use and basic syntax of regular expressions in Javascript_regular expressions

HTML basic syntax and semantic writing rules and examples

The above is the detailed content of Analysis of basic grammar and semantic writing rules and examples of HTML. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!