html programming with css

LuckyTaxi

Diamond Member
Dec 24, 2000
6,044
23
81
so i would like to have different styles on one line but i cant
let me explain.

<div class=blue>i want this text in blue</div><div class=red>i want this text in red</div>
would return the following results.

i want this text in blue (blue text)
i want this text in red (red text)

i dont want the carriage return! how can i make it show up on one line and not one two separate lines?
 

Bullhonkie

Golden Member
Sep 28, 2001
1,899
0
76
Yep:

<span class="blah">blahblah</span>

Been a little while since i've messed around with css so hopefully it still works.
 

LuckyTaxi

Diamond Member
Dec 24, 2000
6,044
23
81
Originally posted by: Bullhonkie
Yep:

<span class="blah">blahblah</span>

Been a little while since i've messed around with css so hopefully it still works.

nice...whats the diff between the two

 

Bullhonkie

Golden Member
Sep 28, 2001
1,899
0
76
The <font> tag has been deprecated, please don't use it. :)

I honestly don't remember the differences as it's been awhile. :eek: But I think it has something to do with the fact that <div> usually defines a block or region of text, while <span> can be used inline to format text within a block of text.
 

ajpa123

Platinum Member
Apr 19, 2003
2,401
1
0
div and span are HTML container elements ( a part or section of a web page) where similar stylin can be applied.

<div> is a block-level container ( contains whole sections of content ) and anything after it starts on a new line !
<span> is an inline container (containing content on just one line) and anything after it starts immediately, i think

AJ
 

LuckyTaxi

Diamond Member
Dec 24, 2000
6,044
23
81
Originally posted by: ajpa123
div and span are HTML container elements ( a part or section of a web page) where similar stylin can be applied.

<div> is a block-level container ( contains whole sections of content ) and anything after it starts on a new line !
<span> is an inline container (containing content on just one line) and anything after it starts immediately, i think

AJ


thank you ... works perfectly!