儿童div离开父div

时间:2017-12-20 22:53:11

标签: html parent

有人知道为什么我的孩子div类离开了它的父div类吗?我不知道它有什么问题!

链接到小提琴和附加代码!

感谢您的帮助!

https://jsfiddle.net/cqynLsqu/

ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo



.table { display: table; }
.row { display: table-row; }
.cell { display: table-cell; }

<div style="border: 1px #000 solid; width: 100%;">
	<div style="background-color: #012055; background-image: url(../images/tableTitle.png); height: 40px; line-height: 40px; color: #fff; font-size: 14px; font-weight: bold; padding-left: 10px;">
		0
	</div>

	<div style="width: 100%; margin: 5px;">
		text text text text text text text text text text text text text text text text text text 
	</div>

	<div class="table" style="width: 100%; margin-right: 5px; margin-left: 5px; border: 1px #000 solid;">
		<div class="row">
			<div class="cell" style="background-color: #012055; background-image: url(../images/tableTitle.png); height: 40px; line-height: 40px; color: #fff; font-size: 14px; font-weight: bold; padding-left: 10px;">
				0
			</div>		
			<div class="cell" style="background-color: #012055; background-image: url(../images/tableTitle.png); height: 40px; line-height: 40px; color: #fff; font-size: 14px; font-weight: bold; padding-left: 10px;">
				0
			</div>
			<div class="cell" style="background-color: #012055; background-image: url(../images/tableTitle.png); height: 40px; line-height: 40px; color: #fff; font-size: 14px; font-weight: bold; padding-left: 10px;">
				0
			</div>
			<div class="cell" style="background-color: #012055; background-image: url(../images/tableTitle.png); height: 40px; line-height: 40px; color: #fff; font-size: 14px; font-weight: bold; padding-left: 10px;">
				0
			</div>
			<div class="cell" style="background-color: #012055; background-image: url(../images/tableTitle.png); height: 40px; line-height: 40px; color: #fff; font-size: 14px; font-weight: bold; padding-left: 10px;">
				0
			</div>
		</div>
		
		<div class="row">
			<div class="cell">
				0
			</div>
			<div class="cell">
				0
			</div>
			<div class="cell">
				0
			</div>
			<div class="cell">
				<b>0</b>
			</div>
			<div class="cell">
				<a href="0">0</a>
			</div>
		</div>
		
	</div>	

</div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

更改此行:

<div class="table" style="width: 100%; margin-right: 5px; margin-left: 5px; border: 1px #000 solid;">

到此:

<div class="table" style="width: 100%; margin-right: 5px; border: 1px #000 solid;">

margin-left正在推出内容。