html - 如何使用 css 创建此边框

标签 html css

我想把这个边框放在我的 html 代码中:

enter image description here

我想要您可以在图片中看到的边框,所以我使用了我的 CSS 代码:

border: 1px outset #999999;
border-top:none;
border-left: none;

结果不一样。任何人都可以帮助重现相同的效果

最佳答案

尝试使用 box-shadow

box-shadow: [horizontal offset] [vertical offset] [blur radius] [optional spread radius] [color];

像这样:

div {
    width: 300px;
    height: 100px;
    background: white;
    box-shadow: 2px 2px 2px rgba(0,0,0,0.25);
}
<div></div>

关于html - 如何使用 css 创建此边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44654628/

相关文章:

html - 在 P 标签中显示代码而不加载它

javascript - 为什么此代码在 Firefox、Safari 和 Edge 上无法正常工作

jquery - jquery获取元素位置的方法

CSS 菜单 : width of dropdown items limited by div

html - 链接处于事件状态时不会变成黄色

php - IE : Sidebar Won't Appear 中的 CSS 问题

javascript - 如何消除 Plotly 图表顶部的空白区域?

javascript - 在粘性标题中计算屏幕尺寸

python - 请求 HTML <img> 作为 text/html

页面加载时的 JavaScript 加载屏幕