html - 将不同颜色的边框应用到 div 的底部
问题描述
我有一个模态,其中底部 10% 左右的颜色与顶部不同,并且无法将边框应用到底部,现在它看起来像这样
.feature-pending {
border: toRem(1px) solid $border-gray;
}
.feature-pending-footer {
position: relative;
background-color: $primary-blue;
min-height: toRem(61px);
&__body {
position: absolute;
top: 50%;
left: 50%;
margin: 0;
margin-right: -50%;
transform: translate(-50%, -50%)
}
}
<div class="feature-pending">
<h1 class="feature-pending__header">
Attention!
</h1>
<p class="feature-pending__body">
The Feature is pending generation of your Townify Home Keyword. If you are a new user please allow 1-2 business days from the day you created your account. if you are not a new user please <a class="feature-pending__contact-support" href="">
contact support</a> for assistance.
</p>
<div class="feature-pending-footer">
<p class="feature-pending-footer__body">Dismiss</p>
</div>
</div>
解决方案
.feature-pending {
border-radius:3px;
}
.feature-pending-footer {
position: relative;
background-color: $primary-blue;
min-height: toRem(61px);
*border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px;*
&__body {
position: absolute;
top: 50%;
left: 50%;
margin: 0;
margin-right: -50%;
transform: translate(-50%, -50%)
}
}
<div class="feature-pending">
<h1 class="feature-pending__header">
Attention!
</h1>
<p class="feature-pending__body">
The Feature is pending generation of your Townify Home Keyword. If you are a new user please allow 1-2 business days from the day you created your account. if you are not a new user please <a class="feature-pending__contact-support" href="">
contact support</a> for assistance.
</p>
<div class="feature-pending-footer">
<p class="feature-pending-footer__body">Dismiss</p>
</div>
</div>
我认为你不能因为边框解决这个问题,你需要删除
边框:toRem(1px) 实心 $border-gray
并添加边框半径,如果你需要的话
推荐阅读
- c++ - 相互分配结构是否存在潜在问题?
- angularjs - 如何使用 AngularJs 处理 Laravel 路由?
- flutter - 用于分层不同小部件并保持某些层透明的博客或教程
- javascript - 如何在 Javascript 中将 PST 时区日期转换为本地时区?
- sql - SQL使用大小写计算一系列数字之间的值
- php - PHP 中真的没有替代 localeconv() 的方法,它不依赖于“当前语言环境”吗?
- traefik-ingress - 对于 k3s 中的 Traefik Ingress Controller,禁用 TLS 验证
- javascript - cookie 返回未定义
- python - 如果我想在遍历数组时比较数组中的元素怎么办
- javascript - 制作条形圆形 echarts