HTML5 study Notes

Source: Internet
Author: User

The HTML5 document must be <! DOCTYPE html> Opening

definition language is English ) or ZH-CN (the definition language is Chinese )

If the browser follows the world standard, the lang attribute can be used to define the style, the class defines the main style, and the lang attribute can be modified on that basis.

Like what:
<style>
p{
Font-family: "The song Body"
font-size:14px;
Color: #F00;
}
P:lang (ZH-CN) {
Font-family: "The song Body"
}
P:lang (en-US) {
Font-family:arial
}
</style>

The main CSS for P tags here only defines the font size and color, and then you need to determine the font by the lang attribute of the tag.
The advantage of the lang attribute is that it's CSS inheritance, perhaps P tags need to define a lot of styles, but different languages (in fact, not just the language) may need to change a small number of styles, if you define these styles separately, it may be like CSS is lengthy, wasting the user's traffic and memory.Share to:
    

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.