MediaSvcsUnlimited Posted January 11, 2016 Share Posted January 11, 2016 (edited) Overall, which is better to use in placing will html elements - pixels or percentages? Edited January 11, 2016 by MediaSvcsUnlimited Quote Link to comment https://forums.phpfreaks.com/topic/300282-pixels-vs-percentage/ Share on other sites More sharing options...
Muddy_Funster Posted January 12, 2016 Share Posted January 12, 2016 That completely depends on what you are coding for. If it's web facing then I would say that what is more important is that, regardless of how you do it, you need to be able to provide a site that will be fully functional regardless of display size. This can either be done by a percentage sized container and adaptive child objects, or by having a series of fixed pixel views and an adaptive presentation based on viewport. it is becoming more common to use the latter option, creating a set of display templates at fixed width and presenting the content dynamically using the appropriate template based on a series of checks on viewport and browser. This gives more control over content like images and menus so that the layout is tailored specifically for the size of screen it is being viewed on. A similar process can be achieved using a percentage container and dynamically rendering the child elements using css values, this impacts page load time however, as the initial container has to be rendered first in order to get the values for the conditional rendering of the children. Quote Link to comment https://forums.phpfreaks.com/topic/300282-pixels-vs-percentage/#findComment-1529499 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.