css 剩余宽度完全填充

从网上转的。

复制代码
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>两列式全屏布局</title>

    <style type="text/css">
        html, body {
            margin: 0;
            padding: 0;
        }

        .top {
            background-color: red;
            border: solid 1px black;
            margin: 0 0 5px 0;
            height: 50px;
        }

        .sidebar {
            position: absolute;
            left: 0;
            top: 57px;
            width: 205px;
            background-color: yellow;
            border: solid 1px black;
            border-left-width: 0;
            height: 50px;
        }

        .main {
            margin-left: 210px;
            background-color: white;
            border: solid 1px black;
            height: 50px;
        }
    </style>

</head>

<body>
    <div class="top">A(固定高度,宽度自适应)</div>
    <div class="sidebar">B(高度任意,宽度为固定)</div>
    <div class="main">C(高度任意,宽度为除开B之外的所有空间,自适应)</div>
</body>
</html>
复制代码

 

posted @   NewSea  阅读(29632)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· 展开说说关于C#中ORM框架的用法!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
历史上的今天:
2011-04-07 MVC中,Ajax Post 数组的实现方案
点击右上角即可分享
微信分享提示