...

View Full Version : HTML Formatting question



boinghd
08-13-2011, 09:04 PM
I'm fairly new to HTML, and this site for that matter, and I'm having trouble formatting a test web page with the .style. tag in the header of the document.
Here's the markup:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/transitional.dtd">
<html>
<head>
<title>TheFieryFurnaces</title>
<meta charset="UTF-8"/>
<style type="text/html">
h1.heade {color:purple;}
p1.par1 {color:Ivory;}
p2.par2 {color: green;}
a.link {color:green;}
</style>
</head>
<!-- It took me forever to figure out how to format the style of the page and now it's all screwy -->
<body style="font-family:verdana;color:ivory;background-color:black;">

I'm posting the complete header because I don't know if it's formatted right, or if it could be cleaned up a bit, so any help would be appreciated.

The class attributes of each paragraph are set as in the style tag, and I'm not sure how to change the colour of the links on my page. The formatting showed up when the .style. tag was incorrectly placed in the body of the document, but when I moved it to the header, the formatting was erased.:confused:

Attached is the entire file...

Sammy12
08-13-2011, 09:13 PM
it's



<style type="text/css">


there's no p1, p2, p3, or p4 either

boinghd
08-13-2011, 09:30 PM
Is that it? Woow now i feel dumb. And as for the p1, p2, etc. I learned from w3schools, and their pages are formatted that way. How can I id each paragraph without doing that?

Sammy12
08-13-2011, 09:44 PM
http://www.w3schools.com/tags/tag_p.asp

you should set a class to each one. id can only be used once. classes can be used multiple times



p.green { color: green; }
p.green-back { background-color: green; }




<p class="green"></p>
<p class="green-back"></p>
<p class="green-back"></p>

boinghd
08-13-2011, 10:01 PM
Thanks for the help!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum