HighDots Forums  

Re: mixed widths and positioning

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Re: mixed widths and positioning in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Re: mixed widths and positioning - 11-13-2003 , 05:11 AM






Brian <usenet1 (AT) julietremblay (DOT) com.invalid-remove-this-part> wrote


Quote:
I'd like to add a graphic to div#navigation, a 140px wide gif file.
Have I painted myself into a corner? How can I place the image in
#navigation and be sure that there is adequate space for both the
image and the text links?
You can just do:

<div id="navigation">

<img src="foo">

<ul> ...Text links... </ul>

</div>

You could get into trouble if 9em < 140 px, which depends on the user's settings.

Garmt.


Reply With Quote
  #2  
Old   
Stanimir Stamenkov
 
Posts: n/a

Default Re: mixed widths and positioning - 11-13-2003 , 06:40 AM






Garmt de Vries wrote:

Quote:
Brian <usenet1 (AT) julietremblay (DOT) com.invalid-remove-this-part> wrote
in message news:<jkwsb.134066$275.396634@attbi_s53>...

I'd like to add a graphic to div#navigation, a 140px wide gif file.
Have I painted myself into a corner? How can I place the image in
#navigation and be sure that there is adequate space for both the
image and the text links?

You can just do:

div id="navigation"

img src="foo"

ul> ...Text links... </ul

/div

You could get into trouble if 9em < 140 px, which depends on the user's settings.
One could try setting 'max-width: 9em' for the image which wouldn't
work everywhere (i.e. IE) but after all we rely on that in most of
the cases 9em would be greater than 140px.

--
Stanimir



Reply With Quote
  #3  
Old   
Markus Ernst
 
Posts: n/a

Default Re: mixed widths and positioning - 11-17-2003 , 03:19 AM



"Stanimir Stamenkov" <s7an10 (AT) netscape (DOT) net> schrieb im Newsbeitrag
news:bovu39$1ia4ln$1 (AT) ID-207379 (DOT) news.uni-berlin.de...

Quote:
One could try setting 'max-width: 9em' for the image
That means resizing the logo which gives very bad display results with
graphics, specially logos.

Quote:
but after all we rely on that in most of
the cases 9em would be greater than 140px.
I am not sure how an em is calculated; from the typographer's point of view
it should equal the font size. If you calculate 140px/9 you get a minimum
font size of 16 pixels which equals 12 points on 96ppi Windows monitors.
That matches quite a large part of the audience. On Mac systems which
calculate screen resolution of 72ppi you get a minimum font size of 16
points which will be greater than most user settings. So these users will
have a bad display.

That's just an approach as some browsers also handle font sizes differently.

--
Markus




Reply With Quote
  #4  
Old   
Stanimir Stamenkov
 
Posts: n/a

Default Re: mixed widths and positioning - 11-17-2003 , 08:09 AM



Markus Ernst wrote:

Quote:
"Stanimir Stamenkov" <s7an10 (AT) netscape (DOT) net> schrieb im Newsbeitrag
news:bovu39$1ia4ln$1 (AT) ID-207379 (DOT) news.uni-berlin.de...

One could try setting 'max-width: 9em' for the image

That means resizing the logo which gives very bad display results with
graphics, specially logos.

but after all we rely on that in most of
the cases 9em would be greater than 140px.

I am not sure how an em is calculated; from the typographer's point of view
it should equal the font size. If you calculate 140px/9 you get a minimum
font size of 16 pixels which equals 12 points on 96ppi Windows monitors.
That matches quite a large part of the audience. On Mac systems which
calculate screen resolution of 72ppi you get a minimum font size of 16
points which will be greater than most user settings. So these users will
have a bad display.

That's just an approach as some browsers also handle font sizes differently.
For your convenience:

img.daImage {
width: 140px;
max-width: 9em;
}

Given the presumption that 9em > 140px on most user systems the
image won't scale larger than 140px therefore there would be no
distortion. When on a particular user system 9em become less than
140px the image will scale down but won't overflow the 9em width
menu container therefore won't cover any important part of the main
document.

--
Stanimir



Reply With Quote
  #5  
Old   
Markus Ernst
 
Posts: n/a

Default Re: mixed widths and positioning - 11-17-2003 , 11:00 AM



"Stanimir Stamenkov" <s7an10 (AT) netscape (DOT) net> schrieb im Newsbeitrag
news:bpaks8$1md6qc$1 (AT) ID-207379 (DOT) news.uni-berlin.de...
Quote:
Given the presumption that 9em > 140px on most user systems the
image won't scale larger than 140px therefore there would be no
distortion. When on a particular user system 9em become less than
140px the image will scale down but won't overflow the 9em width
menu container therefore won't cover any important part of the main
document.
It depends a little on the image but scaling down usually produces bad
results, too. Specially on graphical stuff as type or logos. Imagine a 1
pixel black straight line. It will produce 2 lines of different grey next to
each other if scaled down. Some browsers may handle that better than others,
but there is no control.

--
Markus




Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.