minitutorials main logo the place to learn online

Sponsor This Site!
Sponsorship Details - miniTutorials is taking enquiries into various Sponsorship opportunities. Available NOW! Read More on our Sponsorship page.
Discussion Forums
visit the mini tutorial forums
For expert help and advice on any of our Tutorials or anything else .... visit the forums and ask away!!

Last Five Posts :-


Warning: include() [function.include]: open_basedir restriction in effect. File(/var/virtual/web/w1785/cgi-bin/db.php) is not within the allowed path(s): (/var/kunden/webs/w0003/:/tmp/:/var/www/syscp/:/var/www/roundcubemail-0.2-beta/:/usr/share/phpmyadmin/:/etc/phpmyadmin/:/dev/:/var/kunden/webs/:/var/lib/php5/:/etc/apache2/sites-enabled/) in /var/kunden/webs/w0003/archives/rightbar_archives.ssi on line 21

Warning: include(/var/virtual/web/w1785/cgi-bin/db.php) [function.include]: failed to open stream: Operation not permitted in /var/kunden/webs/w0003/archives/rightbar_archives.ssi on line 21

Warning: include() [function.include]: Failed opening '/var/virtual/web/w1785/cgi-bin/db.php' for inclusion (include_path='.:/usr/share/php:/usr/bin') in /var/kunden/webs/w0003/archives/rightbar_archives.ssi on line 21

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/kunden/webs/w0003/archives/rightbar_archives.ssi on line 24

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/kunden/webs/w0003/archives/rightbar_archives.ssi on line 27
Click on a Topic Title
Google Ads

Cascading Style Sheets

Part One - Go backwards to go forwards

Ok, lets look at the main body of that code again. All the attributes we are going to move to our CSS file in part two are highlighted.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>CSS Tutorial Page - Step 2</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFCC" text="#CC33CC"> <div align="center"> <h1><font color="#FF0000" size="5" face="Verdana, Arial, Helvetica, sans-serif"><strong>The Future is now - CSS to the masses</strong></font> </h1> <strong><font color="#333333">Cascading Style Sheets</font></strong><br /> <strong><font color="#333333"> Part One - Go backwards to go forwards</font></strong> <p>&nbsp;</p> <h3 align="left"><em><font color="#333366" size="+1" face="Times New Roman, Times, serif">This may look like a simple web page, and it is, but you'd be amazed at all the tags (attributes) that it contains!</font></em></h3> <p align="left"><em><font size="+1" face="Georgia, Times New Roman, Times, serif">This line should be the default purple colour, italic in style and Georgia in type.</font></em></p> </div> </body> </html>

Thats a lot of highlighting! Just imagine then a website with a lot more details than this basic page , and over 50 of them with these attributes. A webmasters nightmare to be sure, but we are going to cure that. To keep a website clean, consistent throughout in terms of look and feel, and best of all easy to maintain and make site-wide changes, we remove them all from the web pages and stick them in just one .css file!!, how easy is that.

So with all our highlighted code removed, we are left with this:-

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>CSS Tutorial Page - Step 2</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <div> <h1>The Future is now - CSS to the masses</h1> Cascading Style Sheets <br /> Part One - Go backwards to go forwards <p>&nbsp;</p> <h3>This may look like a simple web page, and it is, but you'd be amazed at all the tags (attributes) that it contains!</h3> <p>This line should be the default purple colour, italic in style and Georgia in type.</p> </div> </body> </html>

Copy and paste the above code into a blank html document and save as step2.html. Much better, easier to read, but how does the page look now?
Once you have previewed it here , use the navigation links below to continue.

left arrow depicting to go back Back to CSS Part One Page One | Forward to CSS Part One Page Three right arrow indicating to go forward

 


 

About Us | Site Map | Privacy Policy | Accessibility |Contact Us | ©2003 - 2007 miniTutorials.com