The preferred way to use this is Cascading Style Sheets (CSS) . This allows you to edit the visual aspects of the site without having to deal with the HTML code itself.
Explanation:
<[tag] style="[css]"> Content </[tag]>
[] . , "p" (), "span", "div", "ul", "li" ..
[css] - CSS. , ": , : 15 , -: "
html - "" (, ), "id" , .
:
<[tag] id="element1" class="red"> Content </[tag]>
<[tag] id="element2" class="red"> Content </[tag]>
- html. id - - , .
CSS ( ):
<style type="text/css">
.red {
color:red;
}
#element1 {
background-color:black;
}
</style>
, "". class= "" - , . CSS , (), . , class= "error" class= "hilight" . ( , )
CSS:
, , CSS, , :
CSS
, , CSS . , , CSS, :
<style type="text/css"> </style>
CSS, . " " , :
<link href="file.css" media="all" rel="stylesheet" type="text/css"/>
file.css - , .
"link" , CSS. , 10 HTML, , CSS.
CSS . , , CSS-, :
<[tag] style="<!-- CSS HERE -->"> Content </[tag]>
CSS
CSS, , , . , , , .
CSS, , , :
, div "basic", , , .
"" :
.[identifier] { }
, ".". , "", :
.basic { }
, , "basic", , "div". :
[html-tag].[identifier] { }
, :
div.basic { }
"div" "body". , . :
div.basic {
background-color:black;
color:white;
border:1px solid gray;
}
"div", "" .
, , "id" , , , , "id"
#unique-basic {
background-color:black;
color:white;
border:1px solid gray;
}
CSS :
http://www.w3schools.com/css/
:
HTML- CSS , . CSS , .