开发者

How to align a Division to the right

开发者 https://www.devze.com 2022-12-21 22:57 出处:网络
I am trying to push my sidebar to the right of my page. When I do this my division gets pushed to the bottom of the p开发者_如何学编程age. Why is this?

I am trying to push my sidebar to the right of my page. When I do this my division gets pushed to the bottom of the p开发者_如何学编程age. Why is this?

Here is my page: link text


It is because You use something like

    <div id="Main">
           <div id="content"></div><div id="sidebar"></div>
    </div>

note that Div is a Block element. You have 2 option to correct this issue. use from an inline element like span (instead of content andsidebar ) or convert div to an in-line element with css like

 #sidebar, #content
 {
      display: inline-block;
 }
0

精彩评论

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