Home » XML Basics » 12 - CSS
12

Basic CSS Commands

Here, you will know which CSS selectors and declarations to use. Also, learn how to make your CSS file and link your CSS file to an HTML file.

Among the many CSS selectors and declarations that you can use are the following:

Selector
Declaration
font-family times new roman
font-family arial
font-style italic
font-weight bold
font-size large
font-size medium
color blue
color red
background-color yellow
background-image enter URL
border-style solid

There are many more selectors and declarations out there that can be learned although it would be impossible to discuss all of them in one chapter. As you continue to program more and more XML, CSS, and HTML files, you will learn a lot of them along the way.

www.cssbeauty.com

www.cssbeauty.com, Polish your CSS skills and see if you could get to the level of the pros. At the CSS Beauty Website, you can see dozens of web designers taking advantage of what CSS has to offer.

Making your CSS file

Make a simple CSS file similar to the code below.

 body {background-color = yellow} h1 {font-size = Large} h2 {font-size = medium} p {color = red}  

When you save your file, make sure that you save it under the *.CSS format. The icon on your desktop should look something like this .

Linking your CSS file to an HTML file

Insert a link in an HTML file like how it was done below.

 <html>  <link rel="stylesheet" type="text/css" href="cccss.css" />  <body>  <h1>This is Header One</h1> <h2>This is Header Two</h2>  <p>This is Paragraph One</p>   </body>  </html>   

Your final output in a browser should look something like the image below.

CSS formated page sample