当前位置: 首页 > 知识库问答 >
问题:

px中的背景3种颜色不是阴影颜色,而是净颜色

蓝苗宣
2023-03-14

我如何创建一个简单的标题与此属性:


    .header {
       width: 100%;
       height: 60px;
       background-color: #FFFFFF;
       /* top 12px background-color:  #ce041d*/
       /*  center color is white */
       /* bottom 12px background-color: #e5e5e5 */ 
    }

作为这个图像?

共有3个答案

太叔凌龙
2023-03-14

可以通过添加上下边框来实现这一点。

像这样的东西:

 .header {
       width: 100%;
       height: 60px;
       background-color: #FFFFFF;
       border-top: 12px solid #ce041d;
       border-bottom: 12px solid #e5e5e5;
    }
<div class="header">
</div>
晋坚
2023-03-14

解决方案一:使用边框。

css lang-css prettyprint-override">.header{
width:100px;
height:40px;
border-top:20px solid #ce041d;
border-bottom:20px solid #e5e5e5;
}
<div class="header"></div>
陈实
2023-03-14

通过使用边框顶部和边框底部。

.header{
width:100px;
height:40px;
border-top:12px solid #ce041d;
border-bottom:12px solid #e5e5e5;
}
html prettyprint-override"><div class="header"></div>
 类似资料:
  • 在超文本标记语言中,我什么时候使用颜色,背景颜色和背景标签有什么区别? 有什么区别?

  • background(int $color, int $pattern = self::PATTERN_SOLID): self int $color $format = new \Vtiful\Kernel\Format($fileHandle); ​ $backgroundStyle = $format->background( \Vtiful\Kernel\Format::COLO

  • 问题内容: 我有一个我想将背景颜色更改为白色的。使用“金属外观”时,我可以通过以下方式实现所需的效果setBackground: 具有白色背景的金属外观风格的JButton 不幸的是,使用Windows LAF时,“背景色”的概念有所不同。背景颜色是按钮周围绘制的颜色: Windows外观风格的JButton,带有白色背景 我想使用Windows LAF,但允许将此按钮的颜色JButton更改为白

  • 我正在制作一个基于文本的游戏,用户输入文本来解决游戏。我决定使用JavaSwing来显示文本,我希望文本窗格的背景为黑色。我已经尝试了所有我发现的东西(注释掉了),但是没有一个看起来有效。 这里没有显示导入的图片,但是当我使用任何被注释掉的部分运行游戏时,游戏中没有错误。

  • 背景颜色是背景应用中最基础的属性,使用 background-color属性,几乎可以为任何元素定义背景颜色,该属性不能被继承,其默认值是 transparent,即透明背景。也就是说,如果一个元素没有显式定义背景颜色,那么其背景是透明的,就可以透过该元素看到其祖先元素的背景。 background-color属性接受任意合法的CSS颜色值,如预定义的颜色名、十六进制数值、RGB值、RGB百分比、

  • 通过RGB值设置背景的颜色。 默认的颜色是 0x000000: // 颜色的参数可以是字符串 "#530000" 或者是十六进制数值 0x530000 controller.setBackgroundColor("#530000); //controller.setBackgroundColor(0x530000);