...

View Full Version : Questions about divs



Tehaxor
10-23-2006, 04:53 PM
Question 1:

There is two boxes side by side, and I type something to the box at the right side until it stretches. Is there a way to get the empty box at the left side to stretch along with the box at right side?

Here's an example:

http://divlayout.cjb.net

Source code:


<html>
<head>
<title>
asd
</title>
<style type="text/css">

div#box {
width:150px;
height:250px;
border:1px solid #000;
float:left;
border-right:0px;
}

div#box2 {
width:150px;
border:1px solid #000;
float:left;
}

</style>
<body>

<div align="center">

<div id="box">
</div>

<div id="box2">
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
Text text text text text<br>
</div>

</div>
</body>
</html>


Question 2:

If I center something at the top of the page, it will always leave an empty space between the top of the page and the object. How could I remove the empty space?

harbingerOTV
10-23-2006, 07:43 PM
1) Search for "Faux Columns". There really isnt a non-javascript way to make them the same height. You can use a background-image to "fake it" though.

2)

body {
padding: 0;
margin: 0;
}


should help out if I understand the question correctly.

Tehaxor
10-23-2006, 07:51 PM
1) Search for "Faux Columns". There really isnt a non-javascript way to make them the same height. You can use a background-image to "fake it" though.

2)

body {
padding: 0;
margin: 0;
}


should help out if I understand the question correctly.

Okay, thanks for your help. And yes, you did understand the second question :P.

croatiankid
10-23-2006, 09:53 PM
as someone on w3c's forums said, your searching for the holy grail



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum