首页 > 解决方案 > 在 CSS 中移动图像

问题描述

我正在努力使用 HTML 和 CSS 将图像集中在网页上。

.header {clear:both; position: relative; display: block; padding: 70px 20px 20px 20px; font-size: 40px; background-color: grey;} 
    #webpic1 {text-align: center !important;} 
    .Title {margin: 5px; padding: 10px; height: 90px; font-family: 'Comfortaa', arial, sans-serif; font-weight: 900; text-align: center;}
 <div class="header"> 
    <div class="webpic"> 
    <img src="images/weblogo.png" alt="RRR" id="webpic1" height="230px" width="270px"> 
    </div> 
    <h3 class="title">RRR</h3>

提前谢谢了

标签: htmlcss

解决方案


利用

.webpic {
  text-align: center
}

或者

#webpic1 {
  display: block;
  margin: auto;
} 

推荐阅读