Log In · Register

 
How do you have different font colors on a DIV layout?, I have a div, and I want some text purple and some text blue.
Kirikireii
post Aug 20 2008, 01:09 PM
Post #1


Newbie
*

Group: Member
Posts: 5
Joined: May 2008
Member No: 652,386



I just made a DIV layout, and I don't know how to make some of the font blue and some of the font purple.

I've tried
CODE
<div class="box" style="position: absolute; left:660px; top:220px; width:287px; height:14px; overflow: auto;">
text. </font>
</div>


and
CODE
<font color=000000> text here. </font>


But neither work.

The only way I can change the font is in the code where it shows this:

CODE
textarea {width:375px; height:35px;}
textarea, .text, td, font, a, body, table, td, li, p, div, br {color:592FFF; font-size:9px; font-family: verdana;}
a:link, a:visited { color: 0072CF; font-size: 9px; text-transform: lowercase; font-family: century gothic; position: fixed;}
a:hover {font-size: 9px; font-family: tahoma; color: 1F9AFF;}


^ Stuff like that.
But that changes everything.
How do I get some of my text on the DIV one color, and the other another color [regular text, not links or whatever.]


Thanks.
Reason for edit: Codebox tags. - Cristy
 
 
Start new topic
Replies
Jghelfi
post Aug 20 2008, 01:17 PM
Post #2


Senior Senior Member
******

Group: Official Member
Posts: 1,507
Joined: Sep 2007
Member No: 571,541



try,
CODE
<div class="box" style="position: absolute; left:660px; top:220px; width:287px; height:14px; overflow: auto;">
<font-color:"COLOR">text.</font>
</div>
 
fixtatik
post Aug 21 2008, 12:07 PM
Post #3


Senior Member
******

Group: Member
Posts: 1,237
Joined: May 2008
Member No: 648,123



QUOTE(Da1nonlyjon @ Aug 20 2008, 02:17 PM) *
try,
CODE
<div class="box" style="position: absolute; left:660px; top:220px; width:287px; height:14px; overflow: auto;">
<font-color:"COLOR">text.</font>
</div>

<font-color:""> isn't an HTML tag, so that won't work.

to kirikireii, i'd say simply assign classes to the lines you want to be a separate color, like so (between your <style> tags):
CODE
.blue { color:blue; }
.purple { color:purple; }

and in your div:
CODE
<div>
  <span class="blue">this is blue text.</span>
  <span class="purple">this is purple text.</span>
</div>
 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: