Sunday, 27 April 2008

Learning CSS

It is a requirement that I make use of CSS (Cascading Style Sheets) in my finished site. I followed some basic tutorials from http://www.w3schools.com/ to get a better understanding of CSS and how I could apply it to my site.

I created 2 files in notepad 'index.html' and 'style1.css' these types of file can be written in a '.txt' file and saved with the '.html' or'.css' extension.

I quickly realised that CSS is mainly used for formatting content in html files. This is very useful to use to format the whole style of the site from a separate external file. This means that several pages can be formatted from a single file, helping to retain a certain style throughout the site.

Here is the html for the page i want to affect with CSS.












Here is the .CSS file that affects the html tags.



Here is how the page appears in a browser.









Using CSS, the design styles of the site can be edited within a separate document, this makes it easy for designers to edit the design of the site separately from the content. (A whole site could be redesigned by only editing the CSS file.)

No comments: