...

View Full Version : Default H2 and CSS



mikacruz
11-02-2008, 11:16 AM
Hello all,
The H2 titles in the content are too big by default as you can see on <this page (http://www.sacred-egypt.com/ancient_egypt/tombs/valley_kings.html)>
What is the best way to define all H2 that are in the div class = "postcontent"?
Is it smth like

h2#postcontent
{
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}

thanks a lot for your advice ;-)

gnomeontherun
11-02-2008, 11:19 AM
Very close


#postcontent h2
{
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}

The outside element comes first (the DIV id), and then H2.

mikacruz
11-02-2008, 11:45 AM
Thanks Jeremy,
Has not worked though, added the code to css line 459. Still big size....
any idea?
oh hang on. thats because I had to define it in the container. works, thanks ;-)

#container h2
{
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}

BabyJack
11-02-2008, 11:47 AM
Jeremy's code was fine.

#postcontent h2
{
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}

Do you have any other H2 tags, that may be over-riding this code?

mikacruz
11-02-2008, 12:02 PM
alright,
reverted to Jeremy's, but as you can see it does not work. If you want to ponder on it, please do, otherwise I will just stick to container h2.
No other H2 tags I dont think, a part from the home page for which I use

<h2 class="menu_titles">Ancient Egypt</h2>
for menu boxes

abduraooft
11-02-2008, 12:11 PM
Wait wait..., the operator to address a class is a period, not #

div.postcontent h2{
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}

BabyJack
11-02-2008, 12:11 PM
Aha, you need a full stop (.) Not a #.

So...

.postcontent h2 {
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}

He beat me :( ^

mikacruz
11-02-2008, 12:14 PM
the error was an appreciation error, the size of the titles H2 being too big, by default compared to paragraph size....

Abdu, your code works. If you have time tell me why your code is more appropriate than

#container h2
{
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}
which works also,
Thanks guys

gnomeontherun
11-02-2008, 12:16 PM
Found the error, your code for postcontent is a class, not an id, so it should be


.postcontent h2
{
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}

Dang everyone at once.

#postcontent refers to a <div> with the id="postcontent"
.postcontent refers to a <div> with the class="postcontent"

Sorry for not reviewing the code the first time from your site, just took what you gave!

abduraooft
11-02-2008, 12:18 PM
Hi mikacruz, see http://www.htmldog.com/guides/cssintermediate/classid/

mikacruz
11-02-2008, 12:23 PM
ok :-)

All work


#container h2
{
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}


div.postcontent h2{
font-family: arial,helvetica,sans-serif;
font-size: 14px;
} will choose that 2nd one :-)



.postcontent h2
{
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}

itsallkizza
11-03-2008, 01:27 AM
(deleted post, wasn't relevant ;))



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum