CSS (cascading style sheets) (1 hours)

Source: Internet
Author: User

1, CSS is all called overlay style sheet, there are 4 ways to introduce in HTML

A, inline style <dic style= "color:red" ></div>

b, Embedded: write in

<style type= "Text/css" >

div{color:red;}

</style>

C, linked <link href= "path to CSS folder" >

D, import style @import URL (CSS path) (generally deprecated, because it is loaded last)

2. CSS Selector

Selector priority: ID selector >class selector > tag Selector

Weight level: Inline style > Inline > Linked type

CSS inheritance: Only font-related properties can be inherited, such as to a DIV set the effect of the font, as well as the height of the width, in the div add a P tag, then the P tag can inherit the div's font style, but can not inherit his width and height (there is a can be inherited, post-supplement, Can only be tested with DIV and P instances for the time being, not clear for other tags)

3. Use border to draw triangles:

The code is:

<style>
. sjx{width:0px;height:0px;
border-width:200px;
Border-style:solid;
Border-left-color: #039;
Border-right-color: #9C0;
Border-top-color: #906;
Border-bottom-color: #666;
Border-left-color:transparent;
Border-top-color:transparent;
Border-bottom-color:transparent;}
</style>
<div class= "SJX" ></div>

4, background commonly used 5 properties: url (image address)

Background-repeat:no-repeat

Background-attachment:fixed (Background map settings, and when the content fills the browser, the browser will automatically appear scroll bar, pull down the scroll bar, the background map to scroll together, this setting is to keep the background map fixed)

CSS (cascading style sheets) (1 hours)

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.