Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - How to make a div ignore a property assigned by body tag?

 
Thread Tools Search this Thread
Old 08-10-2006, 07:13 PM   #1
Default How to make a div ignore a property assigned by body tag?


I must work within a CMS which controls the styles attached to the body
tag -- I cannot alter this:

body {font-size: 13px}

but I *can* change the style of a tag within the body, i.e., ---

#wrap { }

But I cannot figure out how to instruct the wrap division to ignore the
instruction for the default font-size to be 13px. How can the font-size
of the #wrap container be made to be whatever the browser's default may
be?

I have tried
#wrap {font-size: normal}, or
#wrap {font-size: normal!important}, or
#wrap {font-size: 100%!important}, or
#wrap {font-size: 100%}

all without good result.

Please, does anyone know how to cut this Gordian knot?

Thanks!



falconer
  Reply With Quote
Old 08-10-2006, 10:47 PM   #2
Jukka K. Korpela
 
Posts: n/a
Default Re: How to make a div ignore a property assigned by body tag?
falconer <> 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/



Jukka K. Korpela
  Reply With Quote
Old 08-10-2006, 11:43 PM   #3
falconer
 
Posts: n/a
Default Re: How to make a div ignore a property assigned by body tag?
Thank you for the intelligent discussion.

I have worked around the problem with this awful patch, inserted before
the div I wish to free from the designer's bizarre decision to fix the
font-size:
<style>
body {font-size: 100%}
</style>

<sigh>I feel bad, but it does seem to change everything which follows
it. At least in the two browsers I tested. </sigh>

Jukka K. Korpela wrote:
> falconer <> 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/




falconer
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Make about $60,000 in 6 months (i made 20,000).txt (1/1) mr_cool DVD Video 2 03-29-2008 02:11 AM
MAKE HONEST LEGAL MONEY WITH $6.00 linnea_damerau@hotmail.com DVD Video 0 05-18-2006 10:13 AM
MAKE FAST MONEY LEGALLY!!!!!!!!!!!!!!!!!! will_strip_4_banannas_boys@yahoo.com DVD Video 0 02-02-2006 07:03 PM
MAKE FAST MONEY LEGALLY!!!!!!!!!!!!!!!!!! will_strip_4_banannas_boys@yahoo.com DVD Video 0 02-02-2006 06:04 PM
make a lot of money fast! baseballerwc@yahoo.com DVD Video 0 01-31-2006 07:16 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46