网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > 建站交流
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

建站交流 讨论网站建设的基本方法、技巧、空间问题讨论、域名交流、
资源分享、技术交流,站长们经常进来看看噢!

Reply
 
Thread Tools Display Modes
  #1   IP: 117.95.53.44
Old 2010-04-27, 06:02 PM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default 如何实现三个div横向并排呢?

不要放在表格里的,因为容易变形。而是,直接三个赤裸裸的div并排在同一行。

代码如下:

给你个方法:
<div style="float:left; width:30%;">左边版</div>
<div style="float:right;width:30%;">右边版</div>
<div style="float:width:40%;">中间的版</div>
宽度自己设定一下。


如:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>Div元素左中右三列并排</title>

<style type="text/css">
body{text-align:center;}
div{border:1px solid black;padding:1px;margin:1px;}
#main{width:730px;}
#main div
{/*    根据浏览器类型选择display样式    */
    display:inline;    /*IE6*/
/*    display:table-cell;    /*NS9*/
}
#left{width:120px;}
#center{width:480px;}
#right{width:120px;}
</style>

</head>
<body>

<div id="main">
<div id="left">left</div>
<div id="center">center</div>
<div id="right">right</div>
</div>

</body>
</html>
本代码在IE6及NS9上调试通过.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 10:57 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.