Alibaba interview question --------- differences between physical and logical tags in html tags, Alibaba ---------

Source: Internet
Author: User

Alibaba interview question --------- differences between physical and logical tags in html tags, Alibaba ---------
The difference between physical and logical tags in html tags is because the two have the same effect, so people don't care too much about the difference between the two, so today I will tell you, there is a difference.
They differ from physical tags and logical tags.
What is a physical tag? What is a logical tag?
What physical elements emphasize is a kind of physical behavior. For example, if I bold a piece of text with the B mark, I mean that the browser should give me a rough display of the text, from the semantic analysis of words, we can also find that B is short for Bold (Bold), so the meaning of the B mark is only Bold and has no other effect.
Strong, we can understand the meaning of his emphasis literally, so we use this mark to convey a message to the browser that emphasizes a paragraph of text, this Strong is what we call the logical element. It emphasizes the logic of the document, rather than how the browser should display the information.
Similarly, I is Italic (Italic), and em is emphasize (emphasis ).
Therefore, physical elements tell the browser in what format I should display text, and logical elements tell the browser how important these words are.
Used on Web pages. By default, they all act as bold fonts. The difference between the two is that <B> A tag is an entity tag, the character it is surrounded by will be set to bold (bold), and the <strong> label is a logical tag, it is used to enhance the tone of the character, in general, the tone of a reinforced character is implemented by converting the character into bold (bold.
In short, strong is the xhtml tag in the web standard, strong means "Emphasizing", B is html, and B is bold (bold ). The web standard claims that xhtml does not involve specific forms of representation. "Emphasis" can be emphasized in bold or in other ways, such as underscores (_), such as font increase, red, and so on, you can use css to change the specific performance of strong.
It doesn't mean that B is eliminated when strong is used. B indicates that the font is bold because it is consistent with the effect highlighted by strong by default, in fact, this strong can be fully defined as an effect of emphasizing other styles.
However, to comply with W3C standards, strong labels are recommended.
Strong label: the visual effect is bold. HTML semantics indicates the emphasis and aggravation of tone.
When a blind user uses a screen reader, the difference between B and Strong is obvious. Reading B is the same as processing general words. If Strong is encountered, it is aggravated and paused.
Label B: the visual effect is bold. It does not have HTML semantics.
WEB standards advocate the separation of style and content, so it is not recommended to use B purely for the sake of scalability.

From the perspective of XHTML document significance and user experience, strong is more useful and recommended. SEO depends on the optimization.




Therefore, I personally think that we should replace physical tags with logical tags such as strong ..

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.