DPChallenge: A Digital Photography Contest You are not logged in. (log in or register
 

DPChallenge Forums >> Tips, Tricks, and Q&A >> HTML experts: CSS fonts question
Pages:  
Showing posts 1 - 5 of 5, (reverse)
AuthorThread
02/09/2007 06:03:24 AM · #1
This has been driving me nuts all morning. I've got two CSS classes defined, h1 and td.h2 - with exactly the same format. But they display differently! (i.e. the font looks different)

Any ideas? - Here's the code;







test abcdefg


The font above and the font below are exactly the same - why do they look
different in the browser?


test abcdefg




02/09/2007 06:16:07 AM · #2
h1 is level 1 heading tag and bold by default. Add 'font-weight:normal' to h1 style or 'font-weight:bold' to td.h2
02/09/2007 06:18:56 AM · #3
Ahhhh... excellent. It works. Thanks for saving my sanity.
02/09/2007 06:21:21 AM · #4
in td.h2 the h2 is not an CSS tag it's just a name, right ?
so it does not tell the browser how the font should look like,

with td.h2 {
font-size: 20px;
color:#5D98D4;
font-family: Arial, Helvetica, sans-serif;
}

you just defined how the text should look like in table column, nothing else, H1 is built in ...

and the main part is that you defined h1 as CSS class but in

test abcdefg



you enclosed it in pure h1 tag, if you change the name of your h1 css class into h11 and code it

test abcdefg

nothing changes, the difference is because different handling of table,tr, td tags , try this code you'll see what i mean:







test abcdefg


The font above and the font below are exactly the same - why do they look
different in the browser?









test abcdefg

test abcdefg - influenced obviously by the table tags, tr, td






edit: so yea as Tycho said if you want them to be the same do something with the font directly like "bold" properties :-)

anyways ... , tr and td are not used anymore in modern xhtml coding, you put everything into
blocks and design it via CSS ...
okay i'm off now ... :-)

Message edited by author 2007-02-09 06:24:04.
02/09/2007 06:25:42 AM · #5
Originally posted by goc:

in td.h2 the h2 is not an CSS tag it's just a name, right ?
so it does not tell the browser how the font should look like,

Yes, perhaps confusing myself by using the same names as the built-in tags wasn't such a good idea!

Originally posted by goc:

anyways ... , tr and td are not used anymore in modern xhtml coding, you put everything into
blocks and design it via CSS ...

Don't even go there... :)
Pages:  
Current Server Time: 08/31/2025 01:25:29 AM

Please log in or register to post to the forums.


Home - Challenges - Community - League - Photos - Cameras - Lenses - Learn - Help - Terms of Use - Privacy - Top ^
DPChallenge, and website content and design, Copyright © 2001-2025 Challenging Technologies, LLC.
All digital photo copyrights belong to the photographers and may not be used without permission.
Current Server Time: 08/31/2025 01:25:29 AM EDT.