 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
Silvers
Joined: 21 Feb 2008 Posts: 17
|
Posted: Fri Feb 22, 2008 4:43 pm Small Problem |
|
|
|
Ok, just starting CSS, working on the whole h2, h3, h4 things.
My question is, why is this code not working?
<STYLE TYPE="text/css">
<!--
H2
{
color:green;
font-size:30pt;
font-style:bold;
}
-->
</STYLE>
<STYLE TYPE="test/css">
<!--
H4
{
color:blue;
font-size:20pt;
font-style:italic;
}
-->
</STYLE>
<Body background="http://www.bestmyspacegraphics.com/Backgrounds-Myspace/backgrounds-myspace10.gif">
<head><b><h2>My Webpage</h2></b></head>
<P><b><h4>Hi, this is my new webpage to do my coding practice on</h4></B></p>
The H2 shows up in the sentence "My Webpage", but when I try to use H4, it doesn't show up at all. I tried moving the H4 to where H2 is, and it doesn't work. What did I do wrong?Or can there only be one H(variable) per code?Like I can't have h2 and h4, I have to choose one? |
|
sticks464
Joined: 31 Dec 2006 Posts: 1171
|
Posted: Fri Feb 22, 2008 6:50 pm |
|
|
|
You do not need to put style type each time you define an element. Don't use pt for font size, use px or em.
| Code: |
<STYLE TYPE="text/css">
<!--
H2
{
color:green;
font-size:30px;
font-style:bold;
}
H4
{
color:blue;
font-size:20px;
font-style:italic;
}
-->
</STYLE> |
Headings and paragraphs are block level elements and cannot go inside each other. If you want a heading then just do a heading. H tags have bold built in by default.
| Code: |
<h2>Hi, this is my new webpage to do my coding practice on</h2>
<h4>Hi, this is my new webpage to do my coding practice on</h4> |
|
|
Silvers
Joined: 21 Feb 2008 Posts: 17
|
Posted: Fri Feb 22, 2008 7:06 pm |
|
|
|
Oh, ok now I see, thanks. Yup, it works now. Thanks so much Sticks. |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|