Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html css虚线边框,内有标记和图像_Html_Css_Border - Fatal编程技术网

Html css虚线边框,内有标记和图像

Html css虚线边框,内有标记和图像,html,css,border,Html,Css,Border,我正在尝试制作一个优惠券类型的虚线边框,里面有文字和图像。我能够创建文本,但也不知道如何将图片也放在其中 我使用blogger是因为我真的不知道如何编写代码。以下是我目前掌握的情况: <style>h1 {border-style: dashed; background-color:coral;}</style> <h1>Never Pay Full Price for Summer Camp Again. Get Free Coupons, Discount

我正在尝试制作一个优惠券类型的虚线边框,里面有文字和图像。我能够创建文本,但也不知道如何将图片也放在其中

我使用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{ 边框样式:虚线; 背景颜色:珊瑚; 左侧填充:10px; }
h1标题文本图像在语义上不是标题,不应放在h1或任何其他hN标记中。而是根据您的用例使用一个换行部分/aside/div,将标题与下面的图像结合起来

.包裹{ 背景:珊瑚; 边框:虚线; } 标题
一种解决方案是使用CSS中的背景图像和背景位置将图像放置在CSS中,如下所示:

试验{ 边框:1px黑色虚线; 背景图片:url'https://bcs-solution.com/wp-content/uploads/2017/11/Logo_Develop-H100-250x100.jpg;'; 背景重复:无重复; 高度:100px; 背景位置:0px 15px; 宽度:255px; } 我的标题1
别忘了发布你到目前为止尝试过的内容。共享你的html代码是的,共享你的html和CSS代码片段。这将有助于我们理解你的问题。thanks@EricN,您希望图像位于h1标记下方或h1标记背景中。