...

View Full Version : ANother font question



toothmkr57
09-27-2007, 05:22 AM
Yes I am a newbie and boy do I feel like it. Is there a way to have multiple fonts in the same div? like p1, p2, p3, and so on if so how is that written in css and then the markup.

would it be something like;

CSS
#box1 { any selectors...
}
#box1 p {
}
#box1 p1 {
}
.text1 { font: verdana; size: 5px; color: red;}
.text2 { font: arial: wieght: bold; size 20px; color: 555555;}


HTML
<div id="box1">
<p class="text1"> blah blah blah </p>
<p1 class="text2"> and more blah blah</p>

abduraooft
09-27-2007, 06:20 AM
Yes! like

#box1 text1 {
font-family:Verdana;
}
#box1 text2 {
font-family:arial;
}

SuperRoach
09-27-2007, 08:08 AM
Although above is how you do it, the understanding of why would help you.

the chaining or cascading or selectors lets you do some very powerful things. If you want to change the look of somethings, think of how your page is laid out and work from there. For example, you might want to style italic writing inside a paragraph to be a different color. To do that, you'd use #maincontent p i { color:#ddd; } . That line affects all <i> tags inside a paragraph, in the content div



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum