CSS网页宽度自适应100%显示
2010-07-19 20:22
513 查看
800x600及以上的分辨率满屏显示,分辨率小于800时,浏览器窗口底部自动显示滚动条。
<!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>100%</title>
<style type="text/css">
<!--
body {
font-family: MingLiU,PMingLiU;
font-size: 11px;
margin: 0px;
padding: 0px;
}
.top_left {
background-color: #993300;
margin: 0px;
padding: 0px;
float: left;
height: 100px;
width: 770px;
position: relative;
}
.top_right {
background-color: #993366;
margin: 0px;
padding: 0px;
float: right;
height: 100px;
width: 250px;
position: absolute;
right: 0px;
}
.top {
width: 100%;
margin: 0px;
padding: 0px;
background-color: #999999;
height:20px;
display: table;
position: relative;
}
-->
</style>
</head>
<body>
<div class="top" >
<div
class="top_left">此处显示 class "top" 的内容</div>
<div class="top_right">此处显示
class "top_right" 的内容</div>
<div></div>
</div>
</body>
</html>
<!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>100%</title>
<style type="text/css">
<!--
body {
font-family: MingLiU,PMingLiU;
font-size: 11px;
margin: 0px;
padding: 0px;
}
.top_left {
background-color: #993300;
margin: 0px;
padding: 0px;
float: left;
height: 100px;
width: 770px;
position: relative;
}
.top_right {
background-color: #993366;
margin: 0px;
padding: 0px;
float: right;
height: 100px;
width: 250px;
position: absolute;
right: 0px;
}
.top {
width: 100%;
margin: 0px;
padding: 0px;
background-color: #999999;
height:20px;
display: table;
position: relative;
}
-->
</style>
</head>
<body>
<div class="top" >
<div
class="top_left">此处显示 class "top" 的内容</div>
<div class="top_right">此处显示
class "top_right" 的内容</div>
<div></div>
</div>
</body>
</html>
相关文章推荐
- CSS网页布局入门教程5:二列宽度自适应
- css判断不同分辨率显示不同宽度布局实现自适应宽度
- CSS网页布局入门教程6:左列固定,右列宽度自适应
- css判断不同分辨率显示不同宽度布局实现自适应宽度
- css判断不同分辨率显示不同宽度布局实现自适应宽度&css3 @media样式的使用
- 手机网页示例1——通过CSS的宽度百分比设置达到页面自适应效果
- css 网页宽度高度自适应
- CSS网页布局入门教程6:左列固定,右列宽度自适应
- DIV+CSS 布局一行两列,左列固定宽度,右列自适应宽度;设置最小宽度,窗口小的时候显示滚动条.
- css判断不同分辨率显示不同宽度布局实现自适应宽度
- 【CSS】树结构的滚动条岁内容高度自适应显示,树右边列表宽度自适应
- 自适应宽度的网页头部DIV+CSS
- css如何让自适应宽度的块居中显示
- css 图片自适应宽度 CSS实现控制图片自适应显示宽度代码
- CSS网页布局入门教程5:二列宽度自适应
- css判断不同分辨率显示不同宽度布局实现自适应宽度
- css判断不同分辨率显示不同宽度布局实现自适应宽度
- 苹果,谷歌浏览器对设置了100%的DIV层宽度不能自适应,部分网页被隐藏,解决办法!
- DIV+CSS 布局一行两列,左列固定宽度,右列自适应宽度;设置最小宽度,窗口小的时候显示滚动条.
- css判断不同分辨率显示不同宽度布局实现自适应宽度&css3 @media样式的使用