0

I can't seem to figure out why this box is floating down a bit from alignment with it's neighbor. The same code is in use inside the main boxes for the content, so It's a big puzzling, and the parents have nothing special that should be messing with the alignment.

http://jordan.rave5.com/tmpstuff/

I tried vertical-align knowing it wouldn't work with the elements anyway. I'm just confused. Again!

CSS

            .right-large-box {
                float: right;
                width: 300px;
                height: auto;
                padding: 0;
                margin: 0;
                vertical-align: top;
                top: 0;
            }

            .left-large-box {
                height: auto;
                padding: 0;
                margin-right: 310px;
                vertical-align: top;
                top: 0;
            }
4

2 回答 2

1

The top margin of 20px on .large-box is pushing it down inside its container. Remove that and it will sit at the top like you want.

于 2013-04-30T01:31:37.550 回答
0

你已经float: right;.right-large-box班级里声明了,你也应该申请float班级.left-large-box。所以应该是:

.left-large-box {
   float:left; /* add this one */
   height: auto;
   padding: 0;
   margin-right: 310px;
   vertical-align: top;
   top: 0; /* this one actually can be removed */
}

我认为你也可以删除top:0;除非你已经设置position:relative/absolute了这些类。

于 2013-04-30T01:54:33.473 回答