How to make two <div> ... </div> in one line?
6 answers
Float will ruin my alignment to the center of the page. This is what I got, I want to get 2 and 3 in one line without losing page centering. Float does not work, because when you resize the browser, it moves with it.
<head>
<meta http-equiv="Content-Language" content="en-us">
<style type="text/css">
.div1 {
background: #faa;
width: 500;
}
.div2 {
background: #ffc;
width: 400;
margin-right: 100px;
}
.div3 {
background: #cfc;
width: 100;
margin-left: 400px;
}
</style>
</head>
<html>
<body>
<center>
<div class="div1"> This is no 1</div>
<div class="div2"> This is no 2</div>
<div class="div3"> This is no 3</div>
</center>
</body>
</html>
+1