HTMl tag semantic, in simple terms, is to let the tag has meaning, to a piece of content with the most appropriate and most appropriate tag, so that the page has a good structure, page elements have meaning, no matter who can understand what the content is, and is conducive to the search engine. Advantages of semantic tag: 1. Clear HTML structure 2. Good code readability 3. Frictionless reading 4. Search engines can determine the context and weight problems according to the language of the tag 5. Mobile devices can display web pages more perfectly 6. Easy for team maintenance and development
Many large companies now the front end of the very the attention tag semantic, team members can understand very well the page structure, easy to maintain, don’t have to deal with guess what part of the code that content, save a lot of unnecessary time, so in the later page design, slowly will use semantic label one habit, can be a lot of people.
So, HTML5 has a lot of new tags. Article defines an area of the page that is independent of the rest of the document, such as blogs, news, comments, etc. Aside sidebar….
Section is similar to div. Unlike div, section is a semantic tag that represents a section or an article, but div is not semantic and can represent anything.
Html5 multimedia tags
Just two tags, as follows:
<video src="xx.mp4"Controls ></ Video > indicates the video playback tag <audio SRC ="xx.mp3"Controls ></audio> The two controls above the audio playback TAB are displayed on the player console, otherwise it will not play.Copy the code
There are three main video formats on the page: OGG, MP4, WebM, but different browsers do not support this video format uniformly. So we’re going to have all three formats ready for the video, different browsers, different formats. As follows:
## email URL number Range color Date Month Week time
There are a few other attributes html5 needs to be aware of
Required property: Required Auto get focus: Autofoucs placeholder: placeholder