Log in

View Full Version : Using CSS to set width..



BLiZZaRD
11-28-2006, 10:13 PM
I have a nav menu that uses images as the links. I have 10 of them and would like to make them in 2 rows of 5.

I can do this easy enough, as I have a CSS rule in my stylesheet that gives a width, and right now I have it set to 60em.

My question, is how will this affect the look on different browsers/screen res.?

Should I opt for an exact px width, or a percentage, or stick with the em?

mwinter
11-30-2006, 02:58 PM
I have a nav menu that uses images as the links. I have 10 of them and would like to make them in 2 rows of 5.

I can do this easy enough, as I have a CSS rule in my stylesheet that gives a width, and right now I have it set to 60em.

My question, is how will this affect the look on different browsers/screen res.?

60em is awfully wide, and if you use the width property, rather than max-width, anything a little less than a maximised browser window on a 1024x768 screen with no sidebars open will prompt a horizontal scrollbar.



Should I opt for an exact px width, or a percentage, or stick with the em?

If 60em is the width you need to effect that design, no other values are going to help. It's just too wide.

Mike

BLiZZaRD
11-30-2006, 03:14 PM
I tested this, and went with 600px. It was the look of the "nav-bar" that I went with, not ness. the having or not having a horitz. scroll bar. The effect I wanted was that I made rows with the images, and that they wouldn't change when a viewer changed the window size. Like if a 20" monitor fully expanded I wanted it to look the same as if that same monitor minimized to a smaller window size.

I understand that smaller resolutions and smaller screens might have the scroll bar, but I did test in most resolutions on most screen sizes and it looks okay for most of the popular ones, so I am okay with it.