WEB front-end web design 5----Newest and most detailed / CSS cascading style sheet

WEB front-end web design 5 - the latest most complete / CSS cascading style sheet

Introduction: CSS cascading style sheet It can simplify the format code of the webpage. The external stylesheet is also saved by the browser in the cache to speed up the download and display, and also reduces the amount of code that needs to be uploaded. In general, it is very practical.

一,码块:

  <!doctype html>
<html><head><title>CSS cascading style sheet </title>
        <style type="text/css">
        <!-- Fill in the style attribute -->
        </style>
    </head>
<body></body>
</html>

注:The style attribute of the cascading style sheet is A code format wrapped in a style tag in the head tag under the title tag. The style sheet is divided into an external style sheet and an internal style sheet. For details, I will introduce it to you in the following content. 二, use of the definition style selector:

1 selector classification: 1. class selector 2. id selector 3. HTML selector 4. Include selector

1.class selector:

<h1 class="one">1.classSelector is also called class selector, starting with "."This symbol</h1>

Explanation: The class selector is named directly in the tag with class=”name”. When you want to define the style for the selected content in the style tag, start with “.”+name braces, you can use braces to learn style attributes and attribute values. The end of an attribute is separated by a semicolon. 如:<style type="text/css">.one{Attribute: attribute value; }</style>

2.id selector:

<h2 id="two">
2.id|| The selector starts with the 选择器以# symbol. The id name must start with a letter or an underscore. It cannot begin with a letter. </h2>

: The id selector is used directly in the label. Id="name" is named. When you want to define a style for the selected content in the style tag, start with "." + name braces, you can separate the curly braces middle school style attribute and attribute value with a semicolon at the end of an attribute. . 如:<style type="text/css">#one{Attribute: attribute value; }</style>

3.HTML selector:

<|| The |3.html selector is a meta selector that appears as an HTML selector. h3>
3.html选择器就是元选择器,就是把HTML标签作为HTML选择器出现。
</h3>

**Explain: **HTML selector is to use the tag name of the HTML tag to set the property directly. Once you set all the contents of this tag package, it will have this property. 如:<style type="text/css">h3{Attribute: attribute value; }</style>

4.Include selector:

<style type="text/css">.h1 #h2 h3{ attribute: attribute value ; }</style>

解:Includes a selector. The selector on the left contains two or more selectors separated by spaces.

结语:The above mentioned are the style attributes defined in the web page, also known as the internal style sheet. Of course, the HTML style sheet also has an external style sheet and an internal style sheet, which I will write later. It will also continue to be new.

Copyright statement:Non-commercial free reprint - keep signature - indicate the source 签名(TM):TopGradeModel