Position elements with the div tag

前端 未结 5 1600
失恋的感觉
失恋的感觉 2021-01-28 03:50
5条回答
  •  伪装坚强ぢ
    2021-01-28 04:08

    For declarations like left and top to make any sense, you need to apply them to positioned elements:

    #foo {
      position:absolute;
      top:10%;
      left:25%;
    }
    

    Your elements don't appear to have be positioned as absolute or relative.

    There are many other problems with your markup as well that will cause many, many problems. All of your markup should go within the body tag:

    
    
      
        Foo Example
        
      
      
        
        
    Hello World

    Online Demo: http://jsbin.com/efukol/edit

提交回复
热议问题