Html 将箭头图形居中对齐,并触摸上方栏的底部 什么是最好的方法来对准我的箭头图形在中间,也触摸底部的酒吧上面?< /P>

Html 将箭头图形居中对齐,并触摸上方栏的底部 什么是最好的方法来对准我的箭头图形在中间,也触摸底部的酒吧上面?< /P>,html,css,Html,Css,现在,它与左侧对齐,顶部栏和箭头之间有空间 请参阅我的JSFIDLE: 这是我的HTML <!-- Start Form --> <div class="wrapper-twocol"> <div class="twocol_row"> <div class="twocol_cell1"> <div class="form-header">Watch Video</div> <div class="form-a

现在,它与左侧对齐,顶部栏和箭头之间有空间

请参阅我的JSFIDLE:

这是我的HTML

<!-- Start Form -->
<div class="wrapper-twocol">
<div class="twocol_row">
<div class="twocol_cell1">
<div class="form-header">Watch Video</div>
    <div class="form-arrow"><img src="https://www.google.com/help/hc/images/sites_icon_arrow_down_small.gif" width="11" height="12"></div>
<img src="http://www.real.com/resources/wp-content/uploads/2013/06/stream-video1.jpg" width="386" height="279">
    </div>

<div class="twocol_cell2">
<div class="form-header">Watch Video</div>
    <div class="form-arrow"><img src="https://www.google.com/help/hc/images/sites_icon_arrow_down_small.gif" width="11" height="12"></div>
<img src="http://www.real.com/resources/wp-content/uploads/2013/06/stream-video1.jpg" width="386" height="279">

</div>
</div>
<!-- End Form -->

稍微改变一下你的风格。您的div是其父级的整个宽度,因此您只需将div内容居中对齐即可

演示


稍微改变一下你的风格。您的div是其父级的整个宽度,因此您只需将div内容居中对齐即可

演示


稍微改变一下你的风格。您的div是其父级的整个宽度,因此您只需将div内容居中对齐即可

演示


稍微改变一下你的风格。您的div是其父级的整个宽度,因此您只需将div内容居中对齐即可

演示


我建议以下解决方案。 首先,在包装器div中包装箭头:

 <div class="wrapper arrowWrapper"> 
    <div class="form-arrow">
        <img src="https://www.google.com/help/hc/images/sites_icon_arrow_down_small.gif" width="11" height="12">
   </div>
</div>

我建议以下解决方案。 首先,在包装器div中包装箭头:

 <div class="wrapper arrowWrapper"> 
    <div class="form-arrow">
        <img src="https://www.google.com/help/hc/images/sites_icon_arrow_down_small.gif" width="11" height="12">
   </div>
</div>

我建议以下解决方案。 首先,在包装器div中包装箭头:

 <div class="wrapper arrowWrapper"> 
    <div class="form-arrow">
        <img src="https://www.google.com/help/hc/images/sites_icon_arrow_down_small.gif" width="11" height="12">
   </div>
</div>

我建议以下解决方案。 首先,在包装器div中包装箭头:

 <div class="wrapper arrowWrapper"> 
    <div class="form-arrow">
        <img src="https://www.google.com/help/hc/images/sites_icon_arrow_down_small.gif" width="11" height="12">
   </div>
</div>

您只能使用css(从标记中删除箭头图像及其包装) 使用::after选择器。这就是防止重复标记和包装的方法

.form-header::after{
  content: url('https://www.google.com/help/hc/images/sites_icon_arrow_down_small.gif');
  position: absolute;
  left: 50%;
  bottom:-18px;
}

演示如下:

您只能使用css(从标记中删除箭头图像及其包装) 使用::after选择器。这就是防止重复标记和包装的方法

.form-header::after{
  content: url('https://www.google.com/help/hc/images/sites_icon_arrow_down_small.gif');
  position: absolute;
  left: 50%;
  bottom:-18px;
}

演示如下:

您只能使用css(从标记中删除箭头图像及其包装) 使用::after选择器。这就是防止重复标记和包装的方法

.form-header::after{
  content: url('https://www.google.com/help/hc/images/sites_icon_arrow_down_small.gif');
  position: absolute;
  left: 50%;
  bottom:-18px;
}

演示如下:

您只能使用css(从标记中删除箭头图像及其包装) 使用::after选择器。这就是防止重复标记和包装的方法

.form-header::after{
  content: url('https://www.google.com/help/hc/images/sites_icon_arrow_down_small.gif');
  position: absolute;
  left: 50%;
  bottom:-18px;
}

以下是演示:

应为页边距顶部:-3px;应在页边顶部:-3px;应在页边顶部:-3px;应在页边顶部:-3px;将图像设置为display:block将删除标题和图形之间的空间。其他人建议使用负边距,但这并不是必需的,并且会根据浏览器的不同给出不同的结果。将图像设置为“显示:块”将删除页眉和图形之间的空格。其他人建议使用负边距,但这并不是必需的,并且会根据浏览器的不同给出不同的结果。将图像设置为“显示:块”将删除页眉和图形之间的空格。其他人建议使用负边距,但这并不是必需的,并且会根据浏览器的不同给出不同的结果。将图像设置为“显示:块”将删除页眉和图形之间的空格。其他人建议使用负边距,但这并不是必须的,根据浏览器的不同,这会给你带来不同的结果。