Solutionext

CSS

css

css

Cascading Style Sheets are the second layer of a web page and deal with the presentational side of the page (page layout, font size, font colour, margins, padding, images…).
In the same vain as discussed above, there are a couple of approaches to using CSS; placing the CSS in the HTML file or using an external CSS file.

Why use an external CSS file?
 Quicker page load times
 Share the same file across multiple pages
 One update applies to all those pages

 

 

CSS syntax is made up of three parts:
Selector {
Property: Value;
}
Although it may seem complicated at first, once you get started it will all fall in to place. All this means is that for each element (e.g. <p>) you determine how a certain aspect of it (e.g. the font) should be presented (e.g. Arial). For example:

P {
Font-family: Arial;
}
h1 {
Font-size: 14pt;
Color: red;
li {
list-style: disc;
margin-left: 10px;
}

Here I have stated that any text within a <p> tag should be displayed using the Arial font, my <h1> headers should be 14pt and red, and any bullet lists items (<li>) should use a filled in circle (called a ‘disc’) and there should be a 10px margin to the left.
Note: Your CSS won’t work without the curly brackets and a semi-colon to separate the properties and their values, so don’t forget to add them

Powered by Hosting Hut ( Cheap Hosting in UK)

Categories: CSS

Leave a Reply

You must be logged in to post a comment.