HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Small Problem
Post new topic   Reply to topic    HTML Help Forum Index -> CSS
View previous topic :: View next topic  
Author Message
Silvers



Joined: 21 Feb 2008
Posts: 17

PostPosted: Fri Feb 22, 2008 4:43 pm     Small Problem Reply with quote

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

PostPosted: Fri Feb 22, 2008 6:50 pm     Reply with quote

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

PostPosted: Fri Feb 22, 2008 7:06 pm     Reply with quote

Oh, ok now I see, thanks. Very Happy Yup, it works now. Thanks so much Sticks.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> CSS All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial