Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.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
Css 如何在图像中心放置按钮_Css_Center - Fatal编程技术网

Css 如何在图像中心放置按钮

Css 如何在图像中心放置按钮,css,center,Css,Center,我想请你们帮忙在图片中心安排一个按钮。我有以下代码: 顶灯 布里斯班吊灯 您可以使用flexbox在图像中心安排按钮 html格式的 <div class="static1_home1"> <div class="bottom"> <div class="row"> <div class="bos1 col col-lg-7 col-md-7 col-x

我想请你们帮忙在图片中心安排一个按钮。我有以下代码:


顶灯
布里斯班吊灯


您可以使用flexbox在图像中心安排按钮

html格式的

<div class="static1_home1">

  <div class="bottom">
    <div class="row">
      <div class="bos1 col col-lg-7 col-md-7 col-xs-12">
        <a href="#" class="box-inner">
          <img src="https://via.placeholder.com/250" alt="banner" class="img-responsive" />
          <button>my button</button>
        </a>
      </div>

    </div>
  </div>
</div>
.box-inner {
  display: flex;
  align-items: center;
  justify-content: center
}
.box-inner button {
  position: absolute;
}