Jump to content

How to make website contents stay in the same row no matter how much we zoom the browser window


Recommended Posts

Need an another help in using CSS with PHP File

I created a Php File to create Div's (three blue boxes) in the same row of the webpage. but when I zoom the webpage for 3 or 4 times, the boxes go one below another.

My Php File is "index.php"


<!doctype html>

<head>
<title>Test</title>
<link rel="stylesheet" href="stylesheet.css"/>
</head>

<body>
<div id=”Container” align="center">
<div id="left"></div>
<div id="center"></div>
<div id="right"></div>
</div>
</body>

</html>



My CSS File is "Stylesheet.css"


#Container{
margin: 0 auto;
width: 1200px;

}

#left{
background-color: blue;
height:300px ;
width: 100px;
display:inline-block;
}

#center{
background-color: blue;
height:300px ;
width: 100px;
display: inline-block;
}

#right{
background-color: blue;
height:300px ;
width: 100px;
display: inline-block;
}



How to make website contents stay in the same row no matter how much we zoom the browser window

Please help.

Thanks in advance.

How about this.

 

 

<!doctype html>

<head>
<title>Test</title>
</head>

<body>
<style>
#Container{
margin: 0 auto;
width: 100%;
}

#left{
color:white;
background-color: blue;
height:300px ;
width: 100px;
max-width:30%;
display:inline-block;
}

#center{
color:white;
background-color: blue;
height:300px ;
width: 100px;
max-width:30%;
display: inline-block;
}

#right{
color:white;
background-color: blue;
height:300px ;
width: 100px;
max-width:30%;
display: inline-block;
}
</style>
<div id=”Container” align="center">
<div id="left">
column 1 and some extra
</div>
<div id="center">
column 2 and some extra
</div>
<div id="right">
column 3 and some extra
</div>
</div>
</body>

</html>
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.