Currently, I'm exploring the capabilities of the float
property in CSS.
I've been working on adjusting the height of two floating divs.
The following are the two methods:
Method 1.
<div style="overflow: hidden;">
<div style="background: blue;float: left;width: 65%;padding-bottom: 500px;
margin-bottom: -500px;border:1px solid White;">column a<br />column a</div>
<div style="background: red;float: right;width: 35%;
padding-bottom: 500px;margin-bottom: -500px;border:1px solid White;">column b</div>
</div>
Method 2.
<div style="background-color: yellow;">
<div style="float: left;width: 65%; border:1px solid White;">column a</div>
<div style="float: right;width: 35%;border:1px solid White;">column b</div>
<div style="clear: both;"></div>
</div>
Although both methods work, I am looking to apply borders across these columns. However, my attempts to do so have not been successful. Is there a way to add borders that will be compatible with all browsers?
Edited Code
Method 3.
<div style="background-color: yellow;">
<div style="float: left;width: 65%; border-right:1px solid White;">
column acolumn acolumn acolumn acolumn acolumn acolumn acolumn
acolumn acolumn acolumn acolumn acolumn acolumn acolumn acolumn acolumn
acolumn acolumn acolumn acolumn acolumn acolumn acolumn acolumn acolumn
</div>
<div style="float: right;width: 35%;border-right:1px solid White;">column b</div>
<div style="clear: both;"></div>
</div>
Feel free to check out the jsfiddle for reference
The div containing column b does not display the border along its full length.
In Method 1, I encountered difficulty applying the border. Could someone please provide solutions to address these issues in both methods?