Web Design Web Design Forum
Registration is free! Here you can view your subscribed threads, work with private messages and edit your profile and preferences Calendar Find other members Frequently Asked Questions Search
Home Web Design

Convenient web based access to our favorite web design Usenet groups

web design reviews

This is Interesting: Free Magazines for Graphics designers and webmasters  





Pages (5): [1] 2 3 4 5 »   Last Thread  Next Thread
Author
Thread Post New Thread   

<div> expands dramatically due to change in font-size property
 

skeeterbug




quote this post edit post

IP Loged report this post

Old Post  01-12-05 - 12:19 AM  
please see

http://www.geocities.com/operationsengineer1/test.htm

for an idea of how i want my logo header div to be layed out.

when i went to resize "Test" to 2em (from 1em), this is what
happened...

http://www.geocities.com/operationsengineer1/test1.htm

the div expanded to twice the size, too!

this was totally unexpected to me, however, it displays this way in
both ie6 and ff1 so i think it is rendering correctly and i've coded
something incorrectly.

any guidance would be appreciated.



Post Follow-Up to this message ]
Re: <div> expands dramatically due to change in font-size property
 

skeeterbug




quote this post edit post

IP Loged report this post

Old Post  01-12-05 - 12:19 AM  
i should say the div expands proportionally to an increase in the
font-size declaration of that div.

at font-size: 1em; everything is great.

at font-size: 2em; there is a double - even outside my "container" div
which houses the logo header div..



Post Follow-Up to this message ]
Re: <div> expands dramatically due to change in font-size property
 

Steve Pugh




quote this post edit post

IP Loged report this post

Old Post  01-12-05 - 12:19 AM  
"skeeterbug" <jskeith1@san.rr.com> wrote:

>http://www.geocities.com/operationsengineer1/test.htm
>
>for an idea of how i want my logo header div to be layed out.
>
>when i went to resize "Test" to 2em (from 1em), this is what
>happened...
>
>http://www.geocities.com/operationsengineer1/test1.htm
>
>the div expanded to twice the size, too!

Makes sense. You've told the div to be 6 times the font-size and then
you've doubled the font size.

When a length is defined in em the value of 1em varies on the property
being defined:
For font-size 1em = the font-size of the parent element.
For all other properties 1em = the font size of the current element.

Steve



Post Follow-Up to this message ]
Re: <div> expands dramatically due to change in font-size property
 

Jan Roland Eriksson




quote this post edit post

IP Loged report this post

Old Post  01-12-05 - 12:19 AM  
On 11 Jan 2005 13:26:28 -0800, "skeeterbug" <jskeith1@san.rr.com> wrote:

>please see
>http://www.geocities.com/operationsengineer1/test.htm
>for an idea of how i want my logo header div to be layed out.
>when i went to resize "Test" to 2em (from 1em), this is what
>happened...
>http://www.geocities.com/operationsengineer1/test1.htm
>the div expanded to twice the size, too!

Hard to tell really.

Your "strict" doctype declaration will not be picked up by the doctype
sniffers when you serve a page from geocities, so anything that comes
out of that place will be rendered in "quirks" mode regardless of what
you do to try to get it right.

There is no such thing as a free lunch
(or a _free_ www server for that matter :-)

--
Rex




Post Follow-Up to this message ]
Re: <div> expands dramatically due to change in font-size property
 

Harlan Messinger




quote this post edit post

IP Loged report this post

Old Post  01-12-05 - 12:19 AM  
"skeeterbug" <jskeith1@san.rr.com> wrote in message
news:1105478788.797081.118270@f14g2000cwb.googlegroups.com...
> please see
>
> http://www.geocities.com/operationsengineer1/test.htm
>
> for an idea of how i want my logo header div to be layed out.
>
> when i went to resize "Test" to 2em (from 1em), this is what
> happened...
>
> http://www.geocities.com/operationsengineer1/test1.htm
>
> the div expanded to twice the size, too!
>
> this was totally unexpected to me, however, it displays this way in
> both ie6 and ff1 so i think it is rendering correctly and i've coded
> something incorrectly.

The height of the DIV is 6em, which means 6 times "the computed value of the
'font-size' property of the element on which it is used [i.e., the DIV].
" If
you double the DIV's font-size property from 1em to 2em, you've doubled its
computed value, which means you've doubled any value that's defined in terms
of that computed value. In other words: this is the correct behavior.



Post Follow-Up to this message ]
Re: <div> expands dramatically due to change in font-size property
 

Jón Fairbairn




quote this post edit post

IP Loged report this post

Old Post  01-12-05 - 12:19 AM  
Jan Roland Eriksson <jrexon@newsguy.com> writes:

> On 11 Jan 2005 13:26:28 -0800, "skeeterbug" <jskeith1@san.rr.com> wrote:
> 
>
> Hard to tell really.
>
> Your "strict" doctype declaration will not be picked up by the doctype
> sniffers when you serve a page from geocities, so anything that comes
> out of that place will be rendered in "quirks" mode regardless of what
> you do to try to get it right.

Would you care to elaborate? If naďfely I wget the page, and
look at the first two lines I see:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

Where do the "doctype sniffers" sniff?

--
Jón Fairbairn                                 Jon.Fairbairn@cl.cam.ac.uk



Post Follow-Up to this message ]
Re: <div> expands dramatically due to change in font-size property
 

Jan Roland Eriksson




quote this post edit post

IP Loged report this post

Old Post  01-12-05 - 04:16 AM  
On 11 Jan 2005 22:58:32 +0000, "Jón Fairbairn"
<jon.fairbairn@cl.cam.ac.uk> wrote:

>Jan Roland Eriksson <jrexon@newsguy.com> writes:
> 

>Would you care to elaborate?

Sure, this is what the "sniffers" see...

<script language="JavaScript">var PUpage="76001067"; var
PUprop="geocities"; </script>
<script language="JavaScript" src=
"http://www.geocities.com/js_source/pu5geo.js"></script>
<script language="JavaScript"> var thGetOv=
"http://themis.geocities.yahoo.com/themis/h.php";
var thCanURL=
"http://us.geocities.com/operationsengineer1/test.htm";
var thSpaceId="76001067";
var thIP="84.217.65.78";
var thTs="1105479503";
var thCs="2d54c51abf084a05dd92c4abf36a8ffd";
</script>
<noscript>
<link rel="stylesheet" href=

"http://themis.geocities.yahoo.com/jsoff.css?thIP=84.217.65.78&thTs=11054795
03">
</noscript>
<!-- text above generated by server. PLEASE REMOVE -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html> ... etc...

I.e. all parts of Geocities crap gets served first, before your doctype
declaration. "Sniffers" wants to find your doctype declaration as the
first line ever...

>If naďfely I wget the page, and look at the first two lines I see:
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
>"http://www.w3.org/TR/html4/strict.dtd">

Seems like 'wget' is doing some filtering :-)

>Where do the "doctype sniffers" sniff?

Right there at the <!DOCTYPE... thingy, but it has to be the first thing
they encounter, no crap up front that might look like "markup".

--
Rex




Post Follow-Up to this message ]
Re: <div> expands dramatically due to change in font-size property
 

Disco Octopus




quote this post edit post

IP Loged report this post

Old Post  01-12-05 - 04:16 AM  
skeeterbug wrote :
> please see
>
> http://www.geocities.com/operationsengineer1/test.htm
>
> for an idea of how i want my logo header div to be layed out.
>
> when i went to resize "Test" to 2em (from 1em), this is what
> happened...
>
> http://www.geocities.com/operationsengineer1/test1.htm
>
> the div expanded to twice the size, too!
>
> this was totally unexpected to me, however, it displays this way in
> both ie6 and ff1 so i think it is rendering correctly and i've coded
> something incorrectly.
>
> any guidance would be appreciated.

Not sure if this is what you should be considering, but take a look
here anyway....

http://mycoolfish.com/t/thing.html


All the divs are using the same class.  They each have been applied the
same text size in /em/

resize the text and see what happens.  This behaviour is because they
are each nested and inheret each others parent size.
So... the outermost uses 1.2em of its parent (the body) - 100%. the
first ensted element uses 1.2 em of its parent (which is already using
1.2em of its parent)... and so on.

play around and see what happens when you make the em size 1em, 1.2 em,
and .9em.

All expected results because of the nesting.

This may lead you into reason of the behaviour of your page.

Hope it helps.

--
dance with children in the rain



Post Follow-Up to this message ]
Re: <div> expands dramatically due to change in font-size property
 

skeeterbug




quote this post edit post

IP Loged report this post

Old Post  01-12-05 - 04:16 AM  
> Makes sense. You've told the div to be 6 times the font-size and then
> you've doubled the font size.

that makes sense aqs you've explained it, but that IS NOT what i was
trying to do.  i was trying to make the div 6em - period.  well, you
know, at the normal text size in a browser.

i want em so that its size can be adjusted when folks adjust their
browser's text size.

i then want to be code different font-sizes within my 6em div.

i *thought* that is what i did, however, i'm obviously wrong.

i still don't see where i went wrong.  can anyone help?

tia...

>
> When a length is defined in em the value of 1em varies on the
property
> being defined:
> For font-size 1em = the font-size of the parent element.
> For all other properties 1em = the font size of the current element.
>
> 	Steve



Post Follow-Up to this message ]
Re: <div> expands dramatically due to change in font-size property
 

Steve Pugh




quote this post edit post

IP Loged report this post

Old Post  01-12-05 - 12:16 PM  
"skeeterbug" <jskeith1@san.rr.com> wrote:
 
>
>that makes sense aqs you've explained it, but that IS NOT what i was
>trying to do.  i was trying to make the div 6em - period.  well, you
>know, at the normal text size in a browser.

Then make it 3em.

height of element relative to own font size = height of element
relative to default font size / element's own font size relative to
default font size*

3 = 6 / 2

*If there was an inbetween element with font-size 1.2em you would need
to take that into account as well. So instead of dividing by 2 you
would divide by 1.2 because he computed value for the element's
font-size would be 1.2*2 = 2.4 times the browser default.

>i want em so that its size can be adjusted when folks adjust their
>browser's text size.

How much text will you have in your header? As the font size increases
the text may wrap onto a second line, and then onto a third. In this
case it may spill out of the box you're providing. Instead of setting
a height set a bottom padding.

>i still don't see where i went wrong.  can anyone help?

Is there something missing from the description I gave and which you
quoted (and Harlan gives the same explanation in more technical
terms.):
 

Steve



Post Follow-Up to this message ]
Sponsored Links
 





All times are GMT. The time now is 10:00 AM. Post New Thread   
Pages (5): [1] 2 3 4 5 »   Previous Last Thread   Next Thread next
Stylesheets archive | Show Printable Version | Email this Page | Subscribe to this Thread

Popular forums

Adobe Photoshop forum Macromedia Flash Web Site Design
Dreamweaver FrontPage forum
JavaScript Forum XML forum
Style Sheets VRML
Forum Jump:
Rate This Thread:

 

XML RSS Feed web design latest articles Syndicate our forum via XML or simple JavaScript

Web Design archive  Database administration help  


Top Home  -  Register  -  Control Panel   -  Memberlist  -  Calendar  -  Faq  -  Search Top