Understanding CSS Styles

Source: Internet
Author: User

This paper is based on the learning notes in Mu-net.

Introduction to CSS
All called cascading style sheets (cascading style Sheets), which is primarily used to define the display style of HTML content within the browser, such as text size, color, font bold, and so on.
Example:

p{    font-size:12px;    color:red;    Font-weight:bold;}

Advantage

Simple, can be shared using a style

Grammar
Selector {Attribute 1: value 1; Property 2: Value 2;}
Example:

p{font-size:12px;color:red;}

Comments
With C language style,//,/* */

Three basic styles of CSS
In the case of the same weights, priority: inline > Embedded > External.
1. Inline type
is to write the CSS code directly in the existing HTML tag.
Example:

<p style= "color:red;font-size:12px" > here the text is red. </p>

2. Embedded
It is possible to write CSS style code between <style type= "text/css" ></style> tags.
And in general, the embedded CSS style is written in

Example:

<style type= "Text/css" >span{    color:red;} </style>

3. External type
is to put the CSS code in a separate external file, this CSS style file with ". css" as the extension, in Among them, rel= "stylesheet" type= "text/css" is fixed notation cannot be modified.
Example:

<link href= "Base.css" rel= "stylesheet" type= "Text/css"/>

Understanding CSS Styles

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.