How to make the float left and float right on the same line?

后端 未结 5 2349
长发绾君心
长发绾君心 2021-02-20 09:26

The Problem:

     **The left part** (#nav ul li) which float: left
     and **the right part** (#nav .search) which float: right
            **are n         


        
5条回答
  •  感情败类
    2021-02-20 09:59

    You have to use absolute positioning and use left and right alignment.

    #nav ul, #nav .search {
        margin: 5px;
        position: absolute;
        display: inline-block;
    }
    

    Check here http://jsfiddle.net/A8SyJ

提交回复
热议问题