How to make horizontal division using html div tag

2019-02-17 01:26发布

I'm trying to make two horizontal divisons using <div> tag in html, but I couldn't make it. Can anyone help me make horizontal division using html and css with <div> tags?

This is prototype

3条回答
2楼-- · 2019-02-17 01:59

Set the float property for each div to be matched, for example left to each, give each of them enough width so that the parent contains them.

DEMO

查看更多
smile是对你的礼貌
3楼-- · 2019-02-17 02:14
`<div style='float:left'>stuffs</div>
<div style='float:right'>stuffs</div>
<div style='clear:both'></div>`

Works well in every cases and is followed in many places...

查看更多
Ridiculous、
4楼-- · 2019-02-17 02:17
<div id="firstDivistion" class="division"></div>
<div id="secondDivistion" class="division"></div>


.division{
  width:50%;
  height:100px;
  float:left;
}
查看更多
登录 后发表回答