How to position three divs in html horizontally?

前端 未结 4 2256
夕颜
夕颜 2020-12-13 12:20

I am creating a sample website which has three divisions horizontally. I want the left most div to be 25% width, the middle one to be 50% width, and right to be 25% width so

4条回答
  •  别那么骄傲
    2020-12-13 12:30

    I'd refrain from using floats for this sort of thing; I'd rather use inline-block.

    Some more points to consider:

    • Inline styles are bad for maintainability
    • You shouldn't have spaces in selector names
    • You missed some important HTML tags, like and
    • You didn't include a doctype

    Here's a better way to format your document:

    
    
    
    Website Title
    
    
    
    
    Left Side Menu
    Random Content

    Here's a jsFiddle for good measure.

提交回复
热议问题