我正在尝试使用<h1>
文本和内部图像制作优惠券类型的虚线边框。我可以创建文本,但是也无法弄清楚如何在其中获得图片。
我使用Blogger是因为我真的不知道如何编码。这是我到目前为止的内容:
<style>h1 {border-style: dashed;
background-color:coral;}</style>
<h1>Never Pay Full Price for Summer Camp Again. Get Free Coupons, Discount & Special Offers from CampCoupons.com!</h1>
我也想在边框内得到图像,但不知道如何。
最佳答案
图片在语义上不是标题,不应放置在h1(或任何其他hN标签)内。而是使用包装区/ aside / div(取决于您的用例)将标题与如下图像组合。
.wrap {
background: coral;
border: dashed;
}
<div class="wrap">
<h1>Heading</h1>
<img src="http://placehold.it/400/200/" />
</div>
关于html - 带<h1>标签和图像的css虚线边框,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54229524/