CSS on cascading and inheritance of graphic introduction

Source: Internet
Author: User

Three ways to inherit CSS

1. Intra-paragraph inheritance

<p style="color:red;font-size:50px;" > Original style </p>

    1. The original becomes red,

    2. The font size of the text becomes larger

All two are implemented by changing the value of the Style property. Syntax Explanation:

1. Each style attribute will have a different value, and "color:red" expresses the property of the color by a colon.

2. Use semicolon spacing and closing between attributes

3.font-size belongs to composite properties

2. In-Document inheritance

<style> global style to use <style> tags, set between < head> headers

Style–type declaring the role type of CSS

p{Style Property} p is a scope or another label for <table><input> and so on, p is just an example

Inheritance within a document is less than the precedence of inheritance within a segment, so it takes precedence over the paragraph, so at the same time the <p> style, the first source executes the global style, the second executes the paragraph style

    1. Out-of-document inheritance

      1. Role file referencing CSS file styles

      2. Need to first create an additional suffix named CSS file

      3. Edit a file to create a CSS style

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.