Home  >  Article  >  Web Front-end  >  Let’s talk about my understanding of css

Let’s talk about my understanding of css

零下一度
零下一度Original
2017-06-24 11:46:292090browse

We talked about simple HTML on the first day, and simple CSS on the second day. So today, let’s talk about how to use their combination!

First let’s talk about the reference method and how to use it!
 1. Internal style sheet. (Put it in )

<span style="color: #008080">1</span> <span style="color: #800000"><head></span><span style="color: #008080">2</span> <span style="color: #800000">    <style></span><span style="color: #008080">3</span> <span style="color: #ff0000">        div{
4                 color:red:
5     }</span><span style="color: #008080">6</span> <span style="color: #800000">    </style></span><span style="color: #008080">7</span> <span style="color: #800000"><head><br></span>

[Tip]: The red area is the style, and element selector

2. Inline style sheet (style written in the tag)

<p style="color: red;"></p>

Note: The syntax must be style = ""Attributes and attribute values ​​​​in double quotes!

 3. External style sheets (introducing external CSS style sheets) are best placed in the head

<span style="color: #008080">1</span> <span style="color: #800000"><head></span><span style="color: #008080">2</span> <span style="color: #800000">        <link rel="stylesheet"  href="xxx.css?1.1.11"><br>  </head><br></span>

Note: "stylesheet" //Style sheet

href //Address

The xxx in xxx.css is the file name, and it is your customized file name! (Suffix name.css It cannot be changed!)

There is also the CSS selector! The selector is an important part of the CSS style sheet

CSS Selector

 1. Element Selector

div, p, span, hr, etc. Many of the elements that are directly connected to curly braces are element selectors

 2.ID selector (id)

We are here Use the id attribute value in the style sheet to modify the label attribute and style.

Syntax:

       { :; :; }

Then, the effect is like this:

That’s all I’ll write today! And then... I’m going to give up! Because my lecturer said we need to write something taller Don’t write about the basics of what I mentioned above! So I decisively gave up! I will continue to update this when I have time in the future!!!

The above is the detailed content of Let’s talk about my understanding of css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn