You are here: Re: CSS stylesheet with * attribute « HTML « IT news, forums, messages
Re: CSS stylesheet with * attribute

Posted by Jukka K. Korpela on 08/15/07 22:12

Scripsit qbert@gmx.at:

> I am using this stylesheet :
>
> * {font-family:verdana;font-size:15px}
> #ta{font-size:30px;color:red}

Sorry, but it's all wrong. Read a good tutorial on CSS _now_.

(All settings are wrong: using Verdana, setting font-size in pixels, and
setting color without setting background - and pure red is seldom a feasible
color for text.)

> With the #ta class i want to make my table's text look red and big.

Stop wanting that.

> <table id="ta">...
>
> Bad thing: only the red color shows up, font-size stays as defined in
> *

The "*" selector (not an attribute) selects all elements. So you are setting
font-size to 15px for all elements, including td elements (table cells). The
rule with #ta overrides this _only_ for the specific element (the table
element) that has id="ta". Setting font-size for a table does not directly
affect anything. It might affect elements inside the table via inheritance,
but here no inheritance of font-size takes place, since you have set
font-size for all elements.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация