问题描述:

I am trying to get the div to align under the 'featured' section on this page: http://paulsavagejr.com/home.html. Instead, the div is aligning with the right side of the screen even though it has float:left included in its code.

I thought maybe if I defined height on a previous div it would force it down to the right position but that did not work. I also tried display:inline-block as an alternative to see if that helped but only made the divs even more out of place.

The code for the div is:

#clients {

float: left;

background-color: #E2E3E5;

color: #1A1B1D;

width: 19%;

padding-left: 3%;

padding-right: 3%;

padding-top: 20px;

padding-bottom: 20px;

}

The full style sheet is found here: http://www.paulsavagejr.com/assets/css/style-desktop.css

Any help would be greatly appreciated. Particularly, what may be affecting the appearance of the divs using display:inline-block as I know that is more suited for layouts. I've just not been able to get the hang of it for some reason.

网友答案:

On line 123 on your stylesheet, remove float: left;, in summary you should only have this now:

CSS:

#clients {
    background-color: #E2E3E5;
    color: #1A1B1D;
    width: 19%;
    padding-left: 3%;
    padding-right: 3%;
    padding-top: 20px;
    padding-bottom: 20px;
}
相关阅读:
Top