CSS font colour???
- Started
- Last post
- 5 Responses
- mybrokenshoe
Hello i am coding a site at the moment, using css. In the link below you can see the dates of the news items in green. I am using a header tag and then colouring them using a font tag.
My question is can i use a div tag like the .green class i use for doing the type (like the 'headlines and stories' titles) in the middle of the header tags without have a line break?
http://www.sandersshiers.aidan-d…
Is it even worth bothering, i heard someone say that font tags are bad. I am not desperate to be "Mr webstandards" so if not no worries.
P.s i have only checked it on macs, so apologies if it messes up on p.c's.
- dc_again0
with all due respect, you need to do some reading up my friend.
span.green { color: #b3dc10; }
01/03/05 Website Launch
bread and butter stuff.
- blaw0
you can use margin-bottom to eliminate that space.
- dc_again0
it has nothing to do with margins, or padding or anything else.
a h tag (h1, h2, h3, etc) is a block element, meaning it sits on its own line. a div tag is a block element, also meaning that it sits on it's own line.
put them both together (a div inside a h) and they're are unable to share the same line, and so one breaks onto the next.
if you want to insist on using a div rather than span for this, make div.green display inline rather than block.
- mybrokenshoe0
span.green { color: #b3dc10; }
01/03/05 Website Launch
bread and butter stuff.
dc_again(Apr 13 05, 04:10)
Ha ha, yeah for sure dc_again no offence taken.
i am learning whilst 'on the job' so to speak, normally i draw pictures with pencils. so yeah i definately need to read up. I have just had a look at spans and inline elements. Thanks for pointing me in the right direction :)
- blaw0
looks like i misunderstood the question. sorry about that.