以下是一个满足您要求的HTML页面示例:

<!DOCTYPE html>
<html>
<head>
    <style>
        body {
            background-color: white;
            margin: 0;
            padding: 0;
        }
        
        .window {
            background-color: gray;
            width: 300px;
            height: 200px;
            margin: auto;
            margin-top: 50px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        
        .title-bar {
            background-color: #333;
            color: white;
            padding: 10px;
            border-radius: 5px 5px 0 0;
        }
        
        .title-bar .title {
            display: inline-block;
            margin: 0;
        }
        
        .title-bar .icon {
            display: inline-block;
            width: 20px;
            height: 20px;
            background-image: url("icon.png");
            background-size: cover;
            margin-right: 5px;
        }
    </style>
</head>
<body>
    <div class="window">
        <div class="title-bar">
            <div class="icon"></div>
            <h2 class="title">窗口标题</h2>
        </div>
    </div>
</body>
</html>

在该示例中,我们使用了CSS来定义样式。具体的样式设置如下:

  • body 设置背景色为白色,并去掉了默认的边距和内边距。
  • .window 设置窗口的样式,包括背景色、宽度、高度、居中对齐、圆角和阴影效果。
  • .title-bar 设置标题栏的样式,包括背景色、字体颜色、内边距和圆角。
  • .title-bar .title 设置标题文本的样式,将其显示为行内元素,并去掉默认的边距。
  • .title-bar .icon 设置图标的样式,包括宽度、高度、背景图片和右边距。

请将上述代码保存为一个HTML文件,并将图标的路径替换为您自己的图标路径

写一个HTML页面让他背景色为白色中间有一个像WINDOWS11的一个小窗口颜色为灰色不用实现放大关闭等按钮窗口上要有标题还要有一个图标标题所在的div颜色要比窗口深一点并且与窗口的上端和左右对齐

原文地址: http://www.cveoy.top/t/topic/iFjK 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录