Home arrow HTML arrow Page 2 - CSS: Where Little Things Mean a Lot
HTML

CSS: Where Little Things Mean a Lot


You’ve heard of people talking about having a site made using CSS, otherwise known as Cascading Style Sheets. So you decide to have a look at this CSS stuff only to discover that it makes no sense. How can somebody make a site out of this? Well, to put it bluntly, they don’t make a site with CSS; rather they make the site just as they would any other site, using good old HTML and link their page(s) to a CSS file. This file holds all the information on how the page will look; from what color the background is, to what font the body of the site will use.

Author Info:
By: Christopher Duell
Rating: 3 stars3 stars3 stars3 stars3 stars / 28
March 29, 2004
TABLE OF CONTENTS:
  1. · CSS: Where Little Things Mean a Lot
  2. · On to CSS
  3. · CSS and the DIV Tag

print this article
SEARCH DEVARTICLES

CSS: Where Little Things Mean a Lot - On to CSS
(Page 2 of 3 )

I can tell you want to get right to it and give the CSS stuff a go, so go ahead and make a file called ‘style.css’ and save it in the same folder as the HTML page you just made. Open it with a simple text editor, like Notepad, and add the following code:


body{
background
#000000;
color: #FFFFFF;
text-align: center;
font-size: 20pt;
font-family: verdana, arial;
}

Save the file. Now add the following line in the HEAD tag of your HTML file:


<link href="style.css" type="text/css" rel="stylesheet" />

Now go and have a look at your web page again in your browser… a bit different isn’t it? Sure you could have done that with much less code by simply using <font> tags and <center> tags etc., but the main problem with this is that such tags are soon to be deprecated, and CSS is going to completely take over the way we do web design.  Also, if you wish to have a ‘vaild’ (according to the W3C) site, you will have to use CSS and not rely on these <font> tags, etc. That’s just the reason why you almost have to do this, but you should be looking at doing this anyway, as when you make your next page, all you have to do is add one simple line:

<link href="style.css" type="text/css" rel="stylesheet" />

It will look exactly like your first page! You wont need to add all those <font> tags any more!  And, the best part is that when you decide your site doesn’t look good with those colors or the chosen layout, all you have to change is the CSS file, as opposed to every HTML page you have created. Voila! Or Viola! Whichever it is, you’re done! Your entire site has a new, better and fresher look.


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials