开发者

Why does the width change when i change text size?

See this page i'm currently working on. http://lacrosselaundry.com/lacrosseLaundry/contact.php

If i change the font-size for 6 from 14px to 18px it moves the form to the right. Why is that?

I want the form to be all the way over to the right like when the h6 font is 开发者_C百科18px, except i want the h6 font to be 14 px. How do I fix this and why is it happening?


How about setting element sizes? Works for me in firebug.

#main {
    width: 100%;
}
.clearLeft {
    width: 300px;
}

As for reasons, .rightDiv moves (despite having align: right) because parent container (#main) width increase. I.e., you increase font size and container stretches to accomodate changes. Normally divs take up all available width, but having float: left overrides that.


You can try to set the width of #main to 100%, so the #main .rigthDiv element would truly float to the right.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜