Reputation: 1954
Is it possible to float a <ul>
inside a <div>
? If so, how?
Upvotes: 1
Views: 1701
Reputation: 1477
[YES]
CSS:
<style type="text/css">
div.my-div {
width: 200px;
height: 200px;
}
div.my-div ul.left-floated {
width: 100px;
height: 200px;
float: left;
/* display: block; */
}
div.my-div ul.right-floated {
width: 100px;
height: 200px;
float: right;
/* display: block; */
}
.clearfix {
clear: both;
line-height: 0;
font-size: 0;
height: 0;
}
</style>
HTML:
<div class="my-div">
<ul class="left-floated">
</ul>
<ul class="right-floated">
</ul>
<br class="clearfix" />
</div>
Upvotes: 1