CSS style question (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


erinatkins -> CSS style question (5/20/2003 13:45:05)

I am trying to have 2 basic styles for a paragrah. 1 bold one without
Will this work?

p {
color: 0033cc;
background-color: transparent;
font-size: 14px;
font-weight: normal;
}

p1 {
color: 0033cc;
background-color: transparent;
font-size: 14px;
font-weight: bold;
}

Than to get it it to work would I just put <p1> before text & </p1>after text




Reflect -> RE: CSS style question (5/20/2003 14:16:27)

.p1 {
color: 0033cc;
background-color: transparent;
font-size: 14px;
font-weight: bold;
}

<p class=" p1" >Text</p>

By making it a class you can also use it for any HTML tag that you want the text to appear as the same be it <p>, <h3>, etc..

<edit>
Or to play off of inheritance you could...

p {
color: 0033cc;
background-color: transparent;
font-size: 14px;
font-weight: normal;
}

p.p1 {
font-weight: bold;
}

<p class=" p1" >Bold text</p>

</edit>

Brian




erinatkins -> RE: CSS style question (5/20/2003 14:31:55)

That makes sense. [:D]

Thanks for explaining it. Will probably be back with more questions.[:D]




pageoneresults -> RE: CSS style question (5/20/2003 14:57:53)

You can also set that up as a generic class and then use it with other elements...

.bold{
font-weight:bold;
}

Then, wherever you need to use it, you can combine multiple classes with one element...

<p class=" main bold" >

<li class=" ind bold" >

Do this to reduce the amount of code in your style sheet. I just learned this one not long ago and it really opened my eyes on how to effectively trim the bloat from your style sheets.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
6.152344E-02