3 replies [Last post]
Stewart
Offline
Regular
Dundee, Scotland.
Last seen: 15 years 35 weeks ago
Dundee, Scotland.
Joined: 2003-11-16
Posts: 16
Points: 0

Hi Folks.

Sorry about this. I did a search and couldn't find a good answer anywhere. My question is this:

If completely using CSS for your layout. Which unit of size should you use for the width of all your elements. Should it be percentages or pixels? Bearing in mind that I want my pages to show up as near to what I want it in each browser.

Regards.

Stewart.

seb
Offline
Enthusiast
Last seen: 12 years 25 weeks ago
Joined: 2003-09-20
Posts: 208
Points: 0

What's best for width? Pixels or Percentages?

depends on if you want your design to fill the users window or not. The vast majority of sites expand to fit the window - for this you must use percentages. The site I'm working on at the moment is a fixed 1002px wide, so I've used px for everything in it.

Stewart
Offline
Regular
Dundee, Scotland.
Last seen: 15 years 35 weeks ago
Dundee, Scotland.
Joined: 2003-11-16
Posts: 16
Points: 0

Cheers Seb!

Hi Seb.

Thanks for your reply.

I was just asking because of AOL users forinstance who have a crap little window to view the net through.

Every time I use pixels. If I resize my my browser I get moving divs. However, if I use percentages. Things merely alter in size. The problem with percentages is that it's hard to get accuracy of widths for elements.

Looks like I'll just have to work round this.

Thanks again for your input Seb.

Stewart.

Stewart
Offline
Regular
Dundee, Scotland.
Last seen: 15 years 35 weeks ago
Dundee, Scotland.
Joined: 2003-11-16
Posts: 16
Points: 0

Just for the Record.

Hi Again.

Just for the record. Since Mozilla and IE6 both treat % widths differently, am I better to specify All my widths in pixels to ensure that my pages show up in a consistent manner? The reason I ask is because Mozilla seems to extend beyond were it's supposed to here and there.

Is this is because I'm using both percentages and pixels in my page? Should I only use one of them in order to get total accuracy in each browser? If this is so. I will have to go for the pixels method as percentage widths don't seem to be favoured for accuracy in Mozilla. What do you think?

Regards.

Stewart.