Results 1 to 3 of 3

Thread: how to solve diffrent screen resolution layout display big and small problem?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    445

    how to solve diffrent screen resolution layout display big and small problem?

    how to solve diffrent screen resolution layout display big and small problem?
    how to center all page element like http://www.letssingit.com/

  2. #2
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: how to solve diffrent screen resolution layout display big and small problem?

    Quote Originally Posted by wenight
    and small problem?
    how to center all page element like http://www.letssingit.com/
    You can do it with a div inside a div
    Code:
    <html>
    	<head>
    		<title></title>
    	</head>
    	<body>
    		<div style="position:absolute; width:100%; z-index:1;" align="center">
    			<div style="width:600px; z-index:2; background-color:#E0E0E0;" align="left">
    				Place everything inside this div<br>line 2
    			</div>
    		</div>
    	</body>
    </html>

  3. #3
    Hyperactive Member coothead's Avatar
    Join Date
    Oct 2007
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    285

    Re: how to solve diffrent screen resolution layout display big and small problem?

    Hi there wenight,

    have a look at this basic example...
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <style type="text/css">
    html,body {
        margin:0;
        padding:0;
        height:100%;
        background-color:#ccc;
     }
    #container {
        width:758px;
        height:100%;
        border-right:1px solid #000;
        border-left:1px solid #000;
        background-color:#fff;
        margin:auto;
     }
    </style>
    
    </head>
    <body>
    
    <div id="container">
    </div>
    
    </body>
    </html>
    Note:-
    It is imperative that a valid dtd is used. Without one IE will go into Quirks Mode and completely ignore margin:auto;.

    coothead

Posting Permissions

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



Click Here to Expand Forum to Full Width