View Full Version : ANother font question

09-27-2007, 04: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;

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

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

09-27-2007, 05:20 AM
Yes! like

#box1 text1 {
#box1 text2 {

09-27-2007, 07: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