Welcome to WebmasterWorld Guest from 54.205.20.160

Forum Moderators: not2easy

Message Too Old, No Replies

Are there any disadvantages for using %?

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



Hi,

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)

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



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)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



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)

WebmasterWorld Senior Member 10+ Year Member



In a few years? calc() works now.
5:17 pm on Aug 1, 2013 (gmt 0)

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



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)

WebmasterWorld Senior Member 10+ Year Member



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month