Jump to content

margin decreasing as the window size decreases


D.Rattansingh

Recommended Posts

I'm trying to create something like yahoo.com where the content is in the middle and on the outskirts there's a grey margin (or at least something looking like a margin, not sure if it's padding). I was successful, however when the page is resized by the user I want this margin to decrease just like it is on yahoo.com but its not decreasing (go to www.yahoo.com and resize the page and their margin decreases). Anyone knows how to get this margin to decrease?

 

body 
{ 
    font-family: "Lucida Grande", "Lucida Sans";
    background-color: #525252;
    text-align: center;
    margin-left: 150px;
    margin-right: 150px;
    margin-top: 0px;
    margin-bottom: 0px;
    min-width: 650px;
    min-height: 685px;
    color: #00008B;    
}

table
{
    margin:0;
    padding: 0px 2px;
    border-spacing: 0; /* remove the spacing between the borders. */
    width: 950px;
    height: 685px;
    background-color: #C1CDC1;
}

Link to comment
Share on other sites

I don't think this is a margin. Looks like simple html body with content div.

<style type="text/css">
body
{
background-color:#FF6600;
}
#the
{
width: 600px;
margin-right:auto;
margin-left:auto;
height: 100px;
background-color: red;
}
</style>
</head>
<body>

<div id="the">put stuff here</div>

</body>
</html>

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.