homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

Are there any disadvantages for using %?

 6:56 am on Aug 1, 2013 (gmt 0)


Are there any disadvantages for using percentage value to set up width of web page?

Waiting for your answers...



 7:36 am on Aug 1, 2013 (gmt 0)

Welcome to WebmasterWorld!

Not exactly sure what point you are trying to make ... but there are certainly disadvantages to everything. If we are specifically talking just the page width ... the differences in viewport width make
% exceptionally bad.

You need 100% on a mobile device, but maybe no more than 50% at full HD+

Do you have a specific concern behind your question?


 7:39 am on Aug 1, 2013 (gmt 0)

Yes. Any elements that are sized differently may not fit or look right - e.g. a fixed pixel width image, or fonts with em sizes.

You can design around those issues, and they are not usually much of a problem (especially if you use responsive design).


 7:51 am on Aug 1, 2013 (gmt 0)

What are the alternatives? How many side-by-side subdivisions are you using?

In My Personal Opinion ... almost anything in the universe is better than using pixels. But the choice of percentage vs. em depends what the page looks like. Don't let your percentages add up to exactly 100. Leave a little wiggle room.

Come back in a few years and you'll have more options, because CSS3 incorporates computed values ("10% plus one em", "four ems plus 3 pixels", "half of whatever is left over").

Here as elsewhere, it often works out better if you first figure out what you want to do, and then develop the best code to do it.


 4:34 pm on Aug 1, 2013 (gmt 0)

In a few years? calc() works now.


 5:17 pm on Aug 1, 2013 (gmt 0)

Although, it is still just a Candidate Recommendation [webmasterworld.com]. That said, that means the big browser vendors are implementing it.


 11:01 pm on Aug 1, 2013 (gmt 0)

the big browser vendors are implementing it

But they're not implementing it retroactively on browsers that already exist.

This is assuming for the sake of discussion that the site in question is aimed at a random representative pool of humans, rather than on technogeeks who always install the latest software five minutes after it is released.


 11:45 pm on Aug 1, 2013 (gmt 0)

In a few years, it won't be working in those same browsers, too.

Being "only" a candidate recommendation is significant. Standards are built on implementation. No spec will be finalized until there are at least two but, in this case, there are umpteen.

calc() works in all modern, desktop browsers and has for quite some time. It even works in IE9+. So you might only need to adjust for IE8 and below though IE users are used to missing out and wouldn't notice anyway.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved