html - 在 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>
提前谢谢了
解决方案
利用
.webpic {
text-align: center
}
或者
#webpic1 {
display: block;
margin: auto;
}
推荐阅读
- android - 通过单击 RecyclerView 项对整个父视图产生波纹效果
- python - 在 Django 中更改表单邮箱的大小
- python - 使用报纸模块的 Ubuntu 脚本导入错误
- html - Flexbox 不会在浏览器调整大小时换行
- laravel - 修改后将头像保存在 octobercms 数据库中
- ansible - 跟踪/调试 ansible-playbook 变量解析
- json - 如何使用 Observables 获取响应正文
- python - 使用 scipy.optimize 最大化目标函数
- rust - Hyper 中的共享可变状态
- jmeter - 无法在 Jmeter 响应中获取页面的所有内容