是否有可能的方式来填补CSS双边界之间的颜色?(Is there is a possible way to fill color between css double border? [duplica

编程入门 行业动态 更新时间:2024-10-25 05:21:48
是否有可能的方式来填补CSS双边界之间的颜色?(Is there is a possible way to fill color between css double border? [duplicate])

这个问题在这里已经有了答案:

CSS - 需要'三重'边界 1答案

你好,我想在我的css双边框中填充不同的颜色。我知道使用两个边框是可能的。

#parent{
  width:100px;
  height:100px;
  border:1px solid #000;
  display:flex;
  align-items:center;
  justify-content : center;
  background-color:red;
}
#child{
  width:80px;
  height:80px;
  border:1px solid #000;
  background-color:#fff;
} 
  
<div id="parent">
   <div id="child"></div>
</div> 
  
 但在这里,我想有一个单一的边界属性(单 
<div>或任何其他元素)的解决方案。所以我用css 
double Property.Is有任何可能的方法来填补这个double_border上的颜色? 

#element{
  width:100px;
  height:100px;
  border:10px double #000;
} 
  
<div id="element"></div> 
  
 

请注意 : - 有人标记这是可能的重复Another.Just请您阅读Tagg之前的两个问题。 这个问题是不同的,在这个问题上,他要求为不同颜色的两个边框着色。但是在这里我想保留两个相同颜色的边框,我只是想在它们之间填充一些颜色。希望你能理解这个问题。

This question already has an answer here:

Css - Need 'triple' border 1 answer

Hello Guys I Would Like to Fill a Different Color in My css Double Border.I Know that it is Possible by Using Two Borders.

#parent{
  width:100px;
  height:100px;
  border:1px solid #000;
  display:flex;
  align-items:center;
  justify-content : center;
  background-color:red;
}
#child{
  width:80px;
  height:80px;
  border:1px solid #000;
  background-color:#fff;
} 
  
<div id="parent">
   <div id="child"></div>
</div> 
  
 But here I would like to have a solution with a single Border Property(Single 
<div> or any other Element).So I Used css 
double Property.Is there is any Possible way to fill color on this double_border? 

#element{
  width:100px;
  height:100px;
  border:10px double #000;
} 
  
<div id="element"></div> 
  
 

Please Note :- Somebody Tagged That This is Possible Duplicate of Another.Just Please Read Both of the Question before You Tagg. This question is different,on that question he is asking for color the the two borders with different color.but here I would like to keep two borders with same color,I just wanna to fill some color between them.hope you will understand the problem.

最满意答案

您也可以使用多个阴影框:

#element {
  width: 100px;
  height: 100px;
  box-shadow: 0 0 0 3px #000, 0 0 0 6px #f00, 0 0 0 9px #000;
} 
  
<div id="element"></div> 
  
 

You could also use multiple box-shadows:

#element {
  width: 100px;
  height: 100px;
  box-shadow: 0 0 0 3px #000, 0 0 0 6px #f00, 0 0 0 9px #000;
} 
  
<div id="element"></div> 
  
 

更多推荐

本文发布于:2023-07-20 12:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1199647.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有可能   颜色   方式   CSS   fill

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!