CSS introduced four kinds of ways

1. a direct reference, the properties of the label as style

2. style written as part of the label as head of

3. By <link> introduced into an external file css

4 by introducing external file import css

for example:

<! DOCTYPE HTML> 
<HTML lang = "EN">
<head>
<Meta charset = "UTF-. 8">
<title> the Title </ title>
<- introduction of the second aspect of css:! Div --- tags selected by the selector, color --- attribute name, red-- attribute value ->
> - <- <style!>
<- {div ->!
<- Color: Red; -! ->
<---->!
<-!} ->
<-! </ style> ->
<-! 3 ways of introducing css ->
<-! <Link type = "text / css" the href = "css_text.css" the rel = "this stylesheet"> ->
<- fourth mode of introduction css ->!
<style>
@import 'css_text.css';
</ style>


</ head>
<body>
<- introduction of a first embodiment of css -!>
<P style = "Color: Red; background-Color: Black"> P Hello </ P>
<div> Hello DIV1 </ div>
</ body>
</ HTML>
========================================== ==============================================
file named " css_text.css "css file
div{
color:blue;
background-color: green;
}

Guess you like

Origin www.cnblogs.com/startl/p/12152820.html