Results 1 to 15 of 17

Thread: Display Web Page on Standard and Wide Screens

Threaded View

  1. #15
    Join Date
    Mar 2012
    Quote Originally Posted by scottjsn View Post
    Just to extend this thread a bit.

    Out of the 1024px width, I try to create a side bar on the right hand side to host the ads, something like:

    <div id="parent" style="width:1024px">

    <div id="left_pane" style="width:70%>
    content here

    <div id="side_bar" style="width:30%>
    ads here


    Not sure, what is the good way to do it?


    This is not an effective use of % as the parent div is fixed width anyway. Ideally you want the parent div to be 100% and the right bar (advert) div to be fixed width, whilst the left_pane (content) responds to the display width. So you need to decide what range of overall widths you wish to support (say 480px to 1024px), the width of the fixed bar (say 240px), then do some maths to work out what % of the width is available for the content. I.e.:

    % = (min-width - fixed-bar) x 100 / min-width.

    Which, with the suggested figures is (480 - 240) x 100 / 480 = 50%.

    Using % in this way is the simplest way of making the width responsive, but is not the best. Why? because it does not maximize the screen usage on medium resolution displays. E.g. In the above example:

    - On a screen or window 1024px wide it uses only 1024 x 50% + 240 = 752px, leaving 272px blank (i.e. there would be a blank border of 186px either side).

    - The maximum of 1024px width is reached at (1024 -240) * 2 = 1568px screen or window width.

    This is an acceptable performance, but, given that the most commonly used screen display used to view the web (according to w3counter) is 1366px wide, and less than 10% of web browsing is done on screens of 1600px or wider, this is not optimal.

    To maximize the screen usage on medium resolution displays, you need to use either (or both):
    - Position: absolute, and/or
    - Media specific style sheets or media queries.
    Last edited by jedaisoul; 02-26-2014 at 06:24 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center