首頁  >  文章  >  web前端  >  如何使两个div并排_html/css_WEB-ITnose

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

WBOY
WBOY原創
2016-06-24 11:37:021237瀏覽

求助:用的是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