当#content内容比较多的时候,右侧的#links就会被挤走,怎么办呢?
时间:2011-11-30
来源:互联网
当#content内容比较多的时候,右侧的#links就会被挤走。content不会自动折行,怎么来改进呢,什么原因呢?谢谢大家!代码如下
HTML code
HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> <!-- body{ margin:0px; padding:0px; font-size:13px; font-family:Arial, Helvetica, sans-serif;} #container{ position:relative; width:100%; } #banner{ height:80px; border:1px solid #000; text-align:center; background-color:#a2d9ff; padding:10px; margin-bottom:2px; } #content{ float:left; padding-right:200px; background-color:#0033CC; } #links { float:left; width:200px; text-align:center; border:1px solid #000; margin-left:-200px; text-align:center; background-color:#0099CC; } #foot{ clear:both; text-align:center; height:30px; border:1px solid #000; } --> </style> </head> <body> <div id="container"> <div id="banner"></div> <div id="content"></div> <div id="links">links<br /> links<br /> links<br /> links<br /> links<br /> links<br /> </div> <div id="footer"></div> </div> </body> </html>
作者: whsubway 发布时间: 2011-11-30
#content
定义一个宽度,然后加个overflow:hidden;
定义一个宽度,然后加个overflow:hidden;
作者: MuBeiBei 发布时间: 2011-11-30
没搞懂,你content里面又没内容,link也不是设置在右边的,标题的疑问哪里来的
HTML code
HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> <!-- body{ margin:0px; padding:0px; font-size:13px; font-family:Arial, Helvetica, sans-serif; } #container{ position:relative; width:100%; } #banner{ height:80px; border:1px solid #000; text-align:center; background-color:#a2d9ff; padding:10px; margin-bottom:2px; } #content{ float:left; padding-right:200px; background-color:#0033CC; } #links { float:right; width:200px; text-align:center; border:1px solid #000; margin-left:-200px; text-align:center; background-color:#0099CC; } #foot{ clear:both; text-align:center; height:30px; border:1px solid #000; } --> </style> </head> <body> <div id="container"> <div id="banner"></div> <div id="content"></div> <div id="links">links<br /> links<br /> links<br /> links<br /> links<br /> links<br /> </div> <div id="footer"></div> </div> </body> </html>
作者: p2227 发布时间: 2011-11-30
楼主,你先应该设置一下div的宽度和高度,然后在设置和link所占宽度比例,这样就不存在你说的那种问题。
作者: missgd152 发布时间: 2011-11-30
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28