Understanding of basic knowledge of Web pages learn about CSS style sheets

Source: Internet
Author: User
Tags define html page html tags
css| Page | style sheet

Need to have the basic knowledge

Before continuing your study, you need to have a basic understanding of the following knowledge:

    • Html
    • Xhtml

If you want to first learn these items, please visit the relevant tutorials at this site.

CSS Overview
  • CSS refers to cascading style sheets (cascading style Sheets), cascading meaning that multiple style definitions are stacked into one.
  • CSS is the standard layout language used to control the size, color, and layout of elements.
  • CSS is very precise, powerful and easy to write.
  • CSS is invented by the consortium to replace tabular layouts, frameworks, and other non-standard performance methods.
  • Styles (style) define how HTML elements are displayed; Styles are usually stored in style sheets; external style sheets are stored in CSS files.
  • An external style sheet (External style Sheets) can greatly increase your productivity and greatly conserve server bandwidth.
  • The combination of pure CSS layout and XHTML enables separation of performance from structure and makes the site easier to maintain and more user-friendly.

CSS Demo

By using the css,html document, it will be displayed in different output styles.

The style solves a common problem

HTML tags were originally designed to define document content. By using tags such as

Because two major browsers (Netscape and Internet Explorer) constantly add new HTML tags and attributes, such as font labels and color properties, to the HTML specification, it becomes increasingly difficult to create sites that are clearly independent of the document presentation layer.

To address this problem, the World Wide Web Consortium (WWW), the nonprofit Standardization Consortium, has a mission to standardize HTML and create styles (styling) outside of HTML 4.0.

Cascading style sheets are supported in all major browsers.

The style sheet greatly improves productivity

Style sheets define how HTML elements are displayed, and font labels and color attributes in styles such as HTML 3.2 are usually saved in an external. css file. By simply editing a simple CSS document, an external style sheet gives you the ability to change the appearance of all page layouts in the site at the same time.

Because it allows you to control the style and layout of multiple pages at the same time, CSS can be called a breakthrough in the field of web design. As a web developer, you can define styles for each HTML element and apply it to any number of pages you want. For global transformations, simply change the style, and all elements in the site are automatically upgraded.

Multiple styles will cascade into one

Style sheets allow style information to be specified in a variety of ways. Styles can be specified in a single HTML element, in the header element of an HTML page, or in an external CSS file. Even multiple external style sheets can be referenced within a single HTML document.

Cascade Order

When the same HTML element is defined by more than one style, which style is used?

In general, all styles are stacked in a new virtual stylesheet based on the following rules, where the number 4 has the highest precedence.

    1. Browser default settings
    2. External style sheet
    3. Internal style sheet (located inside
    4. Inline style (inside HTML element)

Therefore, inline styles (inside HTML elements) have the highest precedence, which means that it will take precedence over the style declarations in the:



Related Article

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.