Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9058507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:44:24+00:00 2026-06-16T14:44:24+00:00

Trying to build a page layout using html and css, the page contains jQuery

  • 0

Trying to build a page layout using html and css, the page contains jQuery UI selector elements

  • Looking to have

    <div id="content">
        <img id="grid" src="http://placehold.it/350x250"/>
    </div>
    

placed in the center of the screen, equal distance from left, right, top and bottom window edges.

  • And a left hand menu, containing 8 images, 4×2 rowsxcols layout

    <div id="menu" style="width:150px;float:left;">
        <b>Stock images</b><br>
            <ol id="selectable">
                <li id="house.jpg" class="ui-state-default"><img src="http://placehold.it/50x40"/></li>
                <li id="gherkin.jpg" class="ui-state-default"><img src="http://placehold.it/50x40"/></li>
                <li id="water.jpg" class="ui-state-default"><img src="http://placehold.it/50x40"/></li>
                <li id="tree.jpg" class="ui-state-default"><img src="http://placehold.it/50x40"/></li>
                <li id="me.jpg" class="ui-state-default"><img src="http://placehold.it/50x40"/></li>
                <li id="hey.jpg" class="ui-state-default"><img src="http://placehold.it/50x40"/></li>
                <li id="wutang.jpg" class="ui-state-default"><img src="http://placehold.it/50x40"/></li>
                <li id="test.png" class="ui-state-default"><img src="http://placehold.it/50x40"/></li>
        </ol>
    </div>
    <div id="content" style="float:left;">
        <img id="grid" src="http://placehold.it/350x250"/>
    </div>
    

For some reason I cannot adjust the height dimensions of #selectable and #selectalbe li elements.
Selectable elements should not be obstructed by grid element.
Aim is to use percentages when possible instead of hardcoded values so page will render correctly on different sized devices.
The header and footer divs position fine.
Appreciate any help with this!

Heres a jsfiddle of the current layout ..
http://jsfiddle.net/TdNXD/10/
Targetted layout, link

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T14:44:25+00:00Added an answer on June 16, 2026 at 2:44 pm

    Since this was really more of an overhaul than a tweak, it would be a very long answer showing all of the changes that I’ve made to make it work. In that, refer to the result:

    http://fiddle.jshell.net/userdude/TdNXD/16/show/light/

    And the editable fiddle:

    http://fiddle.jshell.net/userdude/TdNXD/16/

    And in gray tones:

    http://fiddle.jshell.net/userdude/TdNXD/17/show/light/

    http://fiddle.jshell.net/userdude/TdNXD/17/

    Now, as your comment indicates, you’re trying to center the img in the middle of the right content area. In the above fiddles, it is in the middle… of that content area (a div#main I added). So if we take into account the width of the nav on the left of #main, you get:

    http://fiddle.jshell.net/userdude/TdNXD/19/show/light/

    http://fiddle.jshell.net/userdude/TdNXD/19/

    Which in color is easier to see centering of the img if it’s all in color:

    http://fiddle.jshell.net/userdude/TdNXD/20/show/light/

    http://fiddle.jshell.net/userdude/TdNXD/20/

    The above does include a slight issue I noticed, in that when the window is resized, the poadding on the #menu narrows, which means the absolute width of the right border then becomes slightly wider than the left #main. It’s probably not or barely noticeable (as in, maybe 6-10px), but I thought I’d mention it.

    Other things to consider:

    • The layout breaks in IE7 and 8. It’s worse in IE7, but in IE8 it’s still pretty horrid. My thought is IE’s lack of support for display: table, min-width, and some special selectors like input[type] (etc.) are the root cause, but I have not confirmed which need to be handled. If you have to support these versions, I would suggest using an IE conditional stylesheet to "fix" IE7/8’s display, which will either involve using float techniques (not recommended, but doable) or (shudder) replacing the semantic markup with actual table` elements.

    • You really need to go through the markup and stylesheet, and most of all take a look at some of the decisions I incorporated into the design. I modified the markup to be more semantic, so you’ll see HTML5 elements like section, aside, article, and nav in place of what was there before. I also wrapped some of the content in p tags if I thought it appropriate. One thing I’m thinking now is that the Stock Images text should probably be in a h2 block, too, since that’s not technically not paragraph text. Same goes for Input URL and Grid Dimensions, although those would probably fit as fieldset and legend candidates due to the functionality.

    • Note as well I removed from my fiddle the parts that weren’t in use, like the #feedback styles).

    • I also gave a min-width to several elements, including the #container. This was driven by the desire to maintain layout integrity in the "Input URL" and "Grid dimensions" inputs. If you want it to be truly responsive and maintain layout integrity from wide to narrow, you need to reflow those at certain widths with size-specific properties.

    Well, it was still a long answer, but hopefully that helps. Let me know if you have any questions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a common page layout with a main content div and
I'm trying to build a page which will have a box-like layout..A top banner
I am trying to build a site using elastic layout. I have used Eric
I'm trying to build a simple html page which include some text paragraph, during
I am trying to build a jquery image slider for my home page ,,,,
I am trying to build a login page using hibernate and struts2. My design
I'm trying to build a page where I have some links, and when clicking
I am trying to build a layout when I have a list of labels
I'm trying to build an admin page using the pages controller and a admin_index()
I am trying to build a page with the following in it: Already have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.