>  기사  >  웹 프론트엔드  >  如何使两个div并排_html/css_WEB-ITnose

如何使两个div并排_html/css_WEB-ITnose

WBOY
WBOY원래의
2016-06-24 11:37:021235검색

求助:用的是width:65px;folat:left;,然而并没有什么卵用,除了死么问题呢,代码贴在下面

<style type="text/css">	*{		margin:0px;		padding:0px;	}	body{		padding-top:10px;	}	.main2{		width:65px;		folat:left;	}	.main{		width:90px;		/*height:80px;*/		margin:0 auto;		/*background:#333;*/		font-size:8px;		font-family:"微软雅黑";		text-align:left;		folat:left;	}	.two .t_left,.two .t_right{		display:inline-block;	}	.two .t_left{		margin-right:8px;	}	.two .t_right{		margin-left:8px;	}</style><script type="text/javascript" src="jquery.min.js"></script>	<script type="text/javascript">	var sprint=window.opener.document.getElementById("printInfo");	document.write(sprint.innerHTML);	printPage();	window.print();	function printPage(){		var show=""; 		var $tr=$(".content");	//返回行数组 		for(var i=0;i<$tr.length;i++){ 			show=show+'<div><div class="main"><div class="one">1</div><div class="two"><span class="t_left">2.1</span><span class="t_right">2.2</span></div><div class="three">3</div></div><div class="main2"><img  src="/../../dgAMS/images/ewm.jpg" / alt="如何使两个div并排_html/css_WEB-ITnose" ></div></div>'; 		} 		document.write(show);			}</script></head><body></body>	<script type="text/javascript"></script>

效果是这样的


回复讨论(解决方案)

我还看了半天,你没发现你打错字了么? 是float  不是folat!

原来是这样

现在所有的都并排了,怎么解决

现在所有的都并排了,怎么解决



那你想要什么样的效果?只要两个并排吗?如果自己两个并排,只需要在它们的外层加一个div,宽度设为一个的两倍,或者多一点点,只要不超过三个的宽度就行。
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.