Raymart Calinao AsthreA Raymart Calinao AsthreA - 1 year ago 70
HTML Question

floating a div into left

Just want to make all my div of list to float to left like this one

enter image description here

just having a hard time and wondering where did i go wrong there, did i put a wrong division or something

my css



My html

<div class = "list_wrapper2" >
<h3><?php echo $letter?></h3>

<?php foreach($pages as $page): ?>
<div class = "list_wrapper" >
<li class="listcss">
<a href="<?php echo BASE_URL;?>/page.php?page=<?php echo e($page['slug']);?>"><?php echo e($page['label']);?></a>
<?php endforeach; ?>
<?php endfor; ?>

Answer Source

Try display: inline-block instead of float: left. Here is an example to get started.

Note: float will wrap the div's to next row on overflow!

.wrapper {
  overflow: scroll;
  white-space: nowrap;
.wrapper > div {
  display: inline-block;
  min-width: 50px;
  min-height: 50px;
  background-color: cornflowerblue;
<div class="wrapper">

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download