PAB ( Programming a Baby ).
CSS.
Doc Include (Include CSS in HTML).
This article belongs to one of my collections of articles with same reference.
CSS means Cascading Style Sheets
CSS is from far, the best way to style your Html Document, a very organized Code
Language that transform completely any web page.
In this Article i will tell you how to Include a Css document inside a Html file,
and i will show you how it happens the interaction between the two.
Lets work ;)
<html>
<head>
<title>My Title</title>
</head>
<body>
</body>
</html>
<html>
<head>
<title>My Title</title>
</head>
<body>
<div id="myID1">
...Some Text
</div>
</body>
</html>
IDs are Identifiers which can be used by the styling arguments or by script languages to model each element inside you HTML document.
You can only have an unique ID per element.
If you desire to give the same format to several HTML elements, you must use a CLASS instead of using an ID.
With a Notepad text file document we create a Css document by rename it for example design.css
Open the Css file and Write some Css code like the one you can see in the Sample2
Note:
if you cannot see the file extensions in WINDOWS OS, then do this:
in WINDOWS 10 open your [FILE EXPLORER], click [File - change folder and search options - view ] and uncheck the [hide extensions for known file types]
in WINDOWS 7/8 open your [FILE EXPLORER], press the [ALT] keyboard key, [Folder options - view ] and uncheck the [hide extensions for known file types].
#myid1 {
font-size:18;
color:blue;
background:yellow;
}
#myid2 {
font-size:14;
color:blue;
background:yellow;
}
.myclass1 {
font-size:16;
color:yellow;
background:black;
}
Now we return to our HTML document and:
Check the Sample 3 where you can see the HTML code with the LINK calling the other CSS file.
<html>
<head>
<title>My Title</title>
<link href="design.css" rel="stylesheet" type="text/css" />
</head>
<body>
<span class="codeComment">...Some Text</span>
</body>
</html>