gpt4 book ai didi

HTML/CSS 边框不缩放,边 Angular 保持可见

转载 作者:行者123 更新时间:2023-11-28 01:12:02 25 4
gpt4 key购买 nike

我想去掉一些白色的 Angular 落空间,让它变得圆润和专业。

我还希望顶部也是圆形的黑色条与红色顶部齐平。

我怎样才能做到这一点?请提供您的解决方案和相关解释,以便我了解需要什么。我是 HTML 和 CSS 的新手,所以我想了解如何最好地完成这项工作。

#container{
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
background-color: maroon;
border-radius:30px;
}

#container nav{
display: block;
width: 100%;
height: 30px;
background-color: black;
-webkit-app-region: drag;
border-radius:30px;
}

#container nav #titleShown{
width:30%;
height: 100%;
line-height: 30px;
color: white;
font-size: 1.2em;
font-weight: bold;
float: left;
padding: 0 0 0 1em;


}


#container nav #buttons{
float: right;
width: 150px;
height: 100%;
line-height: 30px;
background-color: black;
border-radius:5px;

}

#buttons #minimize,
#buttons #maximize,
#buttons #restore,
#buttons #close{
-webkit-app-region: no-drag;
float: left;
height: 100%;
width: 33%;
text-align: center;
color: white;
font-size: 18px;
}

@font-face {
font-family: 'sansationregular';
src: url('../fonts/Sansation-Regular-webfont.eot');
src: url('../fonts/Sansation-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/Sansation-Regular-webfont.woff2') format('woff2'),
url('../fonts/Sansation-Regular-webfont.woff') format('woff'),
url('../fonts/Sansation-Regular-webfont.ttf') format('truetype'),
url('../fonts/Sansation-Regular-webfont.svg#sansationregular') format('svg');
font-weight: normal;
font-style: normal;
}

h1{
color: black;
text-align: center;
text-decoration: underline;
border: 1px solid white;
border-radius: 5px;
font-family: 'sansationregular';
}

h2{
font-family: 'sansationregular';
color: wheat;
}

button{
background-color: black;
color: white;
text-align: center;
display: inline-block;
border : none;

}



body, html{
width: 100%;
height: 100%;
}

*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:monospace;
}
<!DOCTYPE html>
<html lang = "en">
<head>
<link href="css/reset.css" rel="stylesheet">
<link href="css/menu.css" rel="stylesheet">
<title id="title">Trackers</title>
</head>

<body>
<div id="container">
<nav>
<div id="titleShown">
</div>
<div id="buttons">
<button id="minimize">
<span>-</span>
</button>
<button id="maximize">
<span>□</span>
</button>
<button id="close">
<span>&times;</span>
</button>
</div>
</nav>
<div>
<h1 class="name">Tracker(S)</h1> <br>
</div>
</div>


<script src="./init.js"></script>
</body>
</html>

最佳答案

所以,你们很亲近。只有三个小的变化。第一个边界半径你只想要顶部的曲线所以 30px 30px 0px 0px 将解决这个问题。其次,你将导航按钮一直推到右边,所以给它一个 50 像素的右边距——你可能可以使用 30 像素。最后,去掉 1px 的白色边框并用 h1 上下的 hr 元素替换

#container{
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
background-color: maroon;

}

#container nav{
display: block;
width: 100%;
height: 30px;
background-color: black;
-webkit-app-region: drag;
border-radius:30px 30px 0px 0px;
border-left:2px solid white;
border-right:2px solid white;
border-top:2px solid white;
}

#container nav #titleShown{
width:30%;
height: 100%;
line-height: 30px;
color: white;
font-size: 1.2em;
font-weight: bold;
float: left;
padding: 0 0 0 1em;


}


#container nav #buttons{
float: right;
width: 150px;
height: 100%;
line-height: 30px;
background-color: black;
border-radius:5px;
margin-right:30px;

}

#buttons #minimize,
#buttons #maximize,
#buttons #restore,
#buttons #close{
-webkit-app-region: no-drag;
float: left;
height: 100%;
width: 33%;
text-align: center;
color: white;
font-size: 18px;
}

@font-face {
font-family: 'sansationregular';
src: url('../fonts/Sansation-Regular-webfont.eot');
src: url('../fonts/Sansation-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/Sansation-Regular-webfont.woff2') format('woff2'),
url('../fonts/Sansation-Regular-webfont.woff') format('woff'),
url('../fonts/Sansation-Regular-webfont.ttf') format('truetype'),
url('../fonts/Sansation-Regular-webfont.svg#sansationregular') format('svg');
font-weight: normal;
font-style: normal;
}

h1{
color: black;
text-align: center;
text-decoration: underline;
border: 0px solid white;
border-radius: 5px;
font-family: 'sansationregular';
}

h2{
font-family: 'sansationregular';
color: wheat;
}

button{
background-color: black;
color: white;
text-align: center;
display: inline-block;
border : none;

}

hr{
color:white;
}


body, html{
width: 100%;
height: 100%;
}

*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:monospace;
}
<!DOCTYPE html>
<html lang = "en">
<head>
<link href="css/reset.css" rel="stylesheet">
<link href="css/menu.css" rel="stylesheet">
<title id="title">Trackers</title>
</head>

<body>
<div id="container">
<nav>
<div id="titleShown">
</div>
<div id="buttons">
<button id="minimize">
<span>-</span>
</button>
<button id="maximize">
<span>□</span>
</button>
<button id="close">
<span>&times;</span>
</button>
</div>
</nav>
<div>
<hr>
<h1 class="name">Tracker(S)</h1>
<hr><br>

</div>
</div>


<script src="./init.js"></script>
</body>
</html>

关于HTML/CSS 边框不缩放,边 Angular 保持可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52044014/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com