Asterisk problem (CSS)

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
mastermp2
Forum Newbie
Posts: 2
Joined: Sun Jun 06, 2010 1:50 pm

Asterisk problem (CSS)

Post by mastermp2 »

Hello

I am having a problem when using the asterisk is CSS.

The problem is, that is seems that when using the asterisk, I can't used the <font> tag appropriately in other elements.

Here's an example:

<style type="text/css">
* {
font-family:Arial, Helvetica, sans-serif
color:#696969;
font-size:11px;
}

</style>

<p> Hello world </p> (this appears with font size 11px, color #696969; and font family: Arial, Helvetica, sans serif)

<p> <font face="Arial, Helvetica, sans-serif" size="8" color= blue> This should be bigger </font> </p> (this doesn't appear bigger but appears blue)

<p> <font face="Arial, Helvetica, sans-serif" size="1" color= red> This should be smaller </font> </p> (this appears smaller and red)

------------------------------------------------------

Bottom line, it seems that the asterisk (*) not only establishes the "default format" and stuff, but it also seems to establish a limit

Can you help me overcome this issue? I want to be able to put text in a bigger size without having to eliminate the asterisk since most of the text should be smaller
mikosiko
Forum Regular
Posts: 757
Joined: Wed Jan 13, 2010 7:22 pm

Re: Asterisk problem (CSS)

Post by mikosiko »

Edit: because Pytrin gave the right answer... mine didn't contribute to the solution
Last edited by mikosiko on Fri Jun 25, 2010 11:14 am, edited 1 time in total.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Asterisk problem (CSS)

Post by Eran »

The <font> tag is deprecated, so you'd do well to stop using it. Use CSS selectors instead

CSS

Code: Select all

p.larger {
    font-family:Arial, Helvetica, sans-serif;
    font-size:8pt;
    color: blue;
}
HTML

Code: Select all

<p class="larger">....</p>
Post Reply