CSS网页宽度自适应100%显示

本文介绍了一种网页布局方案,该方案能够确保在800x600及以上分辨率下实现满屏显示,并在低于800分辨率时自动显示滚动条。通过使用特定的HTML和CSS代码实现了这一目标。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值