You are here: Re: How to make a div ignore a property assigned by body tag? « HTML « IT news, forums, messages
Re: How to make a div ignore a property assigned by body tag?

Posted by Jukka K. Korpela on 08/10/06 21:47

falconer <incoming@cinemaminima.com> scripsit:

> I must work within a CMS which controls the styles attached to the
> body tag -- I cannot alter this:
>
> body {font-size: 13px}

Sigh. Are you _sure_ you must work under such foolish constraints?

> But I cannot figure out how to instruct the wrap division to ignore
> the instruction for the default font-size to be 13px.

Well, that's simple, e.g.

#wrap { font-size: 16px; }

Of course, fixed font sizes aren't a good idea. But if the _overall_ font
size on a page is set in pixels, does it make sense to set the font size of
some element in some different units?

> How can the
> font-size of the #wrap container be made to be whatever the browser's
> default may be?

By setting it to medium.

> I have tried
> #wrap {font-size: normal}, or

Won't work, since there is no such value defined for the font-size property
in CSS specifications; use

#wrap { font-size: medium; }

> #wrap {font-size: 100%!important}, or
> #wrap {font-size: 100%}

The percentage relates by definition to the font size of the enclosing
element, so it won't help here. Note: The !important specifier is not
needed, since _any_ setting of the font-size property for an element
prevents the inheritance of the property value from the enclosing element.
The specifier would be needed, though, if the overall style sheet contained
e.g.

* { font-size: 13px; }

--
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

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