www.webdeveloper.com
Results 1 to 4 of 4

Thread: Keep DIV in Place when Browser is Resized

  1. #1
    Join Date
    Oct 2008
    Posts
    87

    Keep DIV in Place when Browser is Resized

    In the markup below, I've got two DIV's side by side, if the browser is resized, the left div drops below the other. How can I set i up so that it maintains its position and forces the browser to present a horizontal scroll bar if needed?

    Code:
            <div style="display:table;margin:19px 10px 0px 0px;float:left;font-size:8pt">
                <div style="background-color:white;padding:5px;border:solid #000066;border-width:0px;width:200px">
                    <div style="border: solid 0px #000066;background-color:White;padding:5px">
                        <span style="font-weight:bold;color:#000066">About</span>
                        <div style="border:solid #000066; border-width:1px 0px 0px 0px">
                            This page is a demonstration of how information can be virtually organized making it easier to access.                    
                        </div>
                    </div>
    
                    <br />
                </div>
            </div>
    
            <div style="display:table;margin:19px 0px 0px 0px">
                <div style="background-color:white;padding:5px;border:solid #000066;border-width:0px;width:750px">
                    <div style="border: solid 0px #000066;background-color:White;padding:5px">
                        <span style="font-weight:bold;color:#000066">Login</span>
                        <div style="border:solid #000066; border-width:1px 0px 0px 0px;height:50px;padding:5px;margin-bottom:5px;">
                                                    <a href="images/login.jpg" target="_blank" style="font-size:8pt">Login Example</a>
                        </div>
                        <span style="font-weight:bold;color:#000066">Directory</span>
                    </div>
                </div>
            </div>

  2. #2
    Join Date
    Aug 2010
    Location
    Ohio
    Posts
    32
    Try:

    HTML Code:
    display:block
    Instead of:

    HTML Code:
    display:table

  3. #3
    Join Date
    Aug 2010
    Posts
    33
    Didn't work.

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Wrap in a div with width:980px;

    Suffering from Divitis

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



Recent Articles