Home  >  Article  >  Web Front-end  >  Strange problem with style_html/css_WEB-ITnose

Strange problem with style_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:00:44912browse

Asking a question about style, the HTML code is as follows

<div>	<div style='background-color:#e0e;width:100px;height:100px;display:inline-block;'> </div>	<div style='background-color:#e0e;width:100px;height:100px;display:inline-block;'></div></div>

The effect is as follows:

What I want is that no matter what is placed in the DIV, the two are juxtaposed. I don’t know. Why did the DIV get removed after adding a  ?


Reply to discussion (solution)

You can use float:left to achieve this effect

dc6dce4a544fdca2df29d5ac0ea9906b
6a8c92c72da1ce0c41c4a7778555d8ba 16b28748ea4df4d9c2150843fecfba68
71cbb80b5161eb4db59900755ef38e1e16b28748ea4df4d9c2150843fecfba68
16b28748ea4df4d9c2150843fecfba68

dc6dce4a544fdca2df29d5ac0ea9906b
  e7c0e1ead2f73b9fe6283aac6ac26fda 16b28748ea4df4d9c2150843fecfba68
b8e2fc0252652aedf49373a06746945816b28748ea4df4d9c2150843fecfba68
16b28748ea4df4d9c2150843fecfba68

Text alignment

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn