float:left; vs display:inline; vs display:inline-block; vs display:table-cell;

My Question(s) Are any of these methods preferred by a professional web designer? Are any of these methods prefereed by a web browser when drawing the website? Is this all just personal preference? Are there other techniques I’m missing? Note: Above questions are in regards to designing a multi-column layout float:left; http://jsfiddle.net/CDe6a/ This is the … Read more

How to align 3 divs (left/center/right) inside another div?

I want to have 3 divs aligned inside a container div, something like this: [[LEFT] [CENTER] [RIGHT]] Container div is 100% wide (no set width), and center div should remain in center after resizing the container. So I set: #container{width:100%;} #left{float:left;width:100px;} #right{float:right;width:100px;} #center{margin:0 auto;width:100px;} But it becomes: [[LEFT] [CENTER] ] [RIGHT] Any tips? 20 Answers … Read more

How do you keep parents of floated elements from collapsing? [duplicate]

This question already has answers here: What methods of ‘clearfix’ can I use? (29 answers) Closed 7 years ago. Although elements like <div>s normally grow to fit their contents, using the float property can cause a startling problem for CSS newbies: If floated elements have non-floated parent elements, the parent will collapse. For example: <div> … Read more