Vodstok
10-28-2008, 08:35 AM
Due to popular demand:
Okay, this is for those who want to move past HTML into CSS. For starters, make the following two files, and put them in the same folder:
Second.htm
Css.css
Both should just be empty text files.
Now, copy and paste this into the HTML file:
<head>
<title>Untitled Page</title>
<link rel="Stylesheet" type="text/css" href="style.css" />
</head>
<body>
</body>
</html>
And copy this into the css file:
body
{
}
Save them both and open the html file in a browser. We’re back to the boring old white web page if you read the HTML thread. The first new thing you might notice is this tag:
<link rel="Stylesheet" type="text/css" href="style.css" />
I won’t pretend to know exactly why you need the rel and type tags, but you do, and they will pretty much always use these values, so copy and paste this until you puke. Or not.
Keep it in the Head tags so that the style sheet information will be used by the whole document. Now, the magic of CSS is that it takes all of your formatting out of the html, making your html file “lighter” (less text), which is a good thing, especially for those poor schmucks still using dial up.
It has a unique format all it’s own, but don’t worry, its not very complicated. What we will start with are Element styles. These relate to a specific type of tag, so a, body, form, you get it.
Up above we specified body, so everything we stick in there will affect the Body tag directly. A part of the Cascading is cascading style sheets is that whatever you do to a tag, affects all of the tags within that tag. So if you set the background color of the body tag, and a paragraph tag is in that body tag with no formatting of its own, its background color will be the same.
So for starters, open the .css file, and copy and paste the following over what is already in there:
body
{
background-color:Lime;
}
Okay, this is for those who want to move past HTML into CSS. For starters, make the following two files, and put them in the same folder:
Second.htm
Css.css
Both should just be empty text files.
Now, copy and paste this into the HTML file:
<head>
<title>Untitled Page</title>
<link rel="Stylesheet" type="text/css" href="style.css" />
</head>
<body>
</body>
</html>
And copy this into the css file:
body
{
}
Save them both and open the html file in a browser. We’re back to the boring old white web page if you read the HTML thread. The first new thing you might notice is this tag:
<link rel="Stylesheet" type="text/css" href="style.css" />
I won’t pretend to know exactly why you need the rel and type tags, but you do, and they will pretty much always use these values, so copy and paste this until you puke. Or not.
Keep it in the Head tags so that the style sheet information will be used by the whole document. Now, the magic of CSS is that it takes all of your formatting out of the html, making your html file “lighter” (less text), which is a good thing, especially for those poor schmucks still using dial up.
It has a unique format all it’s own, but don’t worry, its not very complicated. What we will start with are Element styles. These relate to a specific type of tag, so a, body, form, you get it.
Up above we specified body, so everything we stick in there will affect the Body tag directly. A part of the Cascading is cascading style sheets is that whatever you do to a tag, affects all of the tags within that tag. So if you set the background color of the body tag, and a paragraph tag is in that body tag with no formatting of its own, its background color will be the same.
So for starters, open the .css file, and copy and paste the following over what is already in there:
body
{
background-color:Lime;
}