【问题标题】:HTML Custom FrameHTML 自定义框架
【发布时间】:2020-08-13 15:27:40
【问题描述】:

大家好,我希望通过电子邮件模板实现以下目标。

任何人都可以帮助解决这个问题。我一直在尝试使用边界半径,但似乎不起作用。

感谢您的帮助! 提前致谢。

【问题讨论】:

标签: html css html-email


【解决方案1】:

*{
  box-sizing: border-box;
}
.box {
  display: inline-flex;
  width: 200px;
  height: 200px;
  padding: 20px;
  justify-content: center;
  align-items: center;
  position: relative;
}
.box::before{
  content: '';
  width:50%;
  height: 50%;
  position: absolute;
  border-top: 2px solid black;
  border-left: 2px solid black;
  top:0;
  left:0;
}

.box::after{
  content: '';
  width:50%;
  height: 50%;
  position: absolute;
  border-right: 2px solid black;
  border-bottom: 2px solid black;
  bottom:0;
  right:0;
}
<div class="box">
Some Text Here<br>
Some Text Here<br>
Some Text Here<br>
Some Text Here<br>
Some Text Here<br>
Some Text Here<br>
Some Text Here<br>
</div>

【讨论】:

  • 欢迎您在 Stack Overflow 上投稿,但是当一个问题已经有了类似这样的答案时,正确的做法是将其标记为重复,以免网站变得混乱已经回答了多余的问题:) 请参阅Answer well-asked questions in "How to write a good answer"。如果您对此问题有新的答案,可以随时将其添加到重复项指向的原始问题中。
【解决方案2】:

这里已经回答了这个问题:Any way to limit border length?

但我使用了边框宽度,以及 ::before::after

.mainwrapper{
  text-align:center;
  padding:10px;
  margin:auto;
  position:relative;
  width:250px;
}
.mainwrapper:before,.mainwrapper:after{
  position: absolute;
  width: 50px;
  height: 50px;
  border-color: #111;
  border-style: solid;
  content: ' ';
}
.mainwrapper:before{
  top: 0;
  left: 0;
  border-width: 2px 0 0 2px;
}
.mainwrapper:after{
  bottom: 0;
  right: 0;
  border-width: 0 2px 2px 0;
}
<div class="mainwrapper">
    <p>something text here</p>
    <p>something text here</p>
    <p>something text here</p>
    <p>something text here</p>
    <p>something text here</p>
    <p>something text here</p>
</div>

【讨论】:

  • 欢迎您在 Stack Overflow 上投稿,但是当一个问题已经有了类似这样的答案时,正确的做法是将其标记为重复项,以免网站变得混乱已经回答的多余问题:) 请参阅Answer well-asked questions in "How to write a good answer"。如果您对此问题有新的答案,可以随时将其添加到重复项指向的原始问题中。
猜你喜欢
  • 1970-01-01
  • 2013-01-06
  • 1970-01-01
  • 2010-09-09
  • 2012-07-02
  • 2010-12-19
  • 2016-05-03
  • 2017-12-27
  • 1970-01-01
相关资源
最近更新 更多