CSS basic Syntax Simple introduction

Source: Internet
Author: User

CSS basic Syntax Simple introduction:
This section introduces the basic syntax of CSS, more suitable for beginners to read, for the slightly experienced personnel, there is little help, can skip.
The main ways to use CSS are the following three types:

1. In-line style 2. Inline style 3. Outer style

Of course, the names in different textbooks may vary, but the substance is the same, not too tangled.
Here are the three ways to use the above separately.
I. In-line style:
The so-called inline style is through the label's style property, the CSS code is written in the tag, the code is as follows:

<style= "Color:blue">softwhy.com</Div  >

Advantage is the use of simple, the shortcomings are very obvious, contrary to the principle of separation of performance and content, so it is not recommended to use.
Two. Inline style:
The inline style is to say that the CSS code is written to the <style> tag, the code is as follows:

<styletype= "Text/css">Div{font-size:12px;Color:Green;}</style>

Usually the <style> label should be placed in the head, but can also be placed in other places. The application of this method is also very simple and convenient, but if the CSS code more, it will make the page very large.
Three. Outreach Style:
The outer style is to introduce a CSS file into the current page with the following code:

<rel= "stylesheet"  type= "text/css"  href= " Style.css "/>

This is recommended when there is more CSS code.
Four. Common selector:
Of course there are many popular selectors, because this chapter is for beginners, so introduce the most basic and commonly used selectors.

1.HTML Tag Selector 2. Group selector 3. Include selector 4.Class selector 5.ID Selector

Here is not introduced, you can refer to the relevant articles can be.
Related reading:
1. The tag selector can be found in the CSS type selector (E) section.
2. The group selector selector can be found in the section on selector grouping for CSS .
3. The Include selector selector can refer to the include selector (E F) section of the CSS .
The 4.class selector can be found in the class selector section of CSS .
The 5.id selector can refer to the ID selector section of the CSS .

The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=15647

For more information, refer to: http://www.softwhy.com/divcss/

CSS basic Syntax Simple introduction

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.