What is a CSS style sheet? A detailed example of CSS style sheets

Source: Internet
Author: User
What is a style sheet

CSS is the abbreviation for cascading Style Sheet. Translated "cascading style sheets". is a markup language for (enhanced) Control of Web page styles and allows the separation of style information from Web page content.

How to add a style sheet to your Web page

You can add style sheets to your Web page in three ways. The style definition closest to the target is the higher priority. The high priority style inherits the non-overlapping definition of the low-priority style but overrides the overlapping definition. Exceptions see the important declaration.

Linking to an external style sheet file (linking to a style Sheet)

You can first create an external style sheet file (. css) and then use the HTML link object. Examples are as follows:


In XML, you should include in the declaration area as shown in the following example:

<? Xml-stylesheet type= "Text/css" href= "Www.dhtmlet.com/rainer.css"?>>

Defining an inner Style block object (embedding a style block)

You can insert a <STYLE>...</STYLE> block object between the <HTML> and <BODY> tags of your HTML document. Define how to see style sheet syntax. Examples are as follows:


Note that the Type property of the Style object is set to "Text/css", which allows browsers that do not support this type to ignore style forms.

Inline definition (inline Styles)

Inline definitions define the style sheet properties that apply to the object using its Style property within the object's markup. Examples are as follows:

<p style= "margin-left:0.5in; margin-right:0.5in "> This line has been added around the outside patch <p>

Style sheet Syntax (CSS Syntax)

Selector {Property:value}
Parameter description:
Selector--Selector
Property:value--style sheet definition. The property and property values are separated by a colon (:). The definitions are separated by semicolons (;)

Inherited values (the ' Inherit ' value)

Each property has a specified value: Inherit. It means that the value of the parent object is equal to the computer's worth. This value is usually just a fallback. An explicit declaration that it can be used to emphasize.

The

CSS is an abbreviation for cascading Style Sheet. Cascading style sheets, cascading style sheets, and more.
for an example. For example, table or Div is to do the bricks and mortar of the house, use them to put the frame of the whole website well. And CSS is the decoration of the house. It's hard to see a website without decorations.
We usually use CSS to decorate the site's colors, text and so on.
to learn more about CSS, you can search online, many online. I'm just using my practice to tell you. Finally, I just want to say that the style and frame are inseparable.

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.