css - CSS - 将几个文本居中
问题描述
我正在寻找一种使文本居中的方法。
我现在的文字有问题。请问如何正确对齐我的文本?解决方案存在于 stackoverflow 上,但我没有得到想要的结果。
我想使用一种简单的方法,因为我是初学者。
下面是我的代码,我希望我的代码总体上是正确的。
非常感谢您的帮助。
.wrapper {
display:flex;
flex-wrap: nowrap;
}
.image-wrapper{
margin: 10px;
text-align: center;
width: 90%;
}
/* All of these styles are shared by the .img element */
.img {
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
margin-top: 50px;
border: 3px solid red;
height: 197px;
width: 90%;
}
.img.img-01 {
background-image: url("https://zupimages.net/up/19/51/vn88.jpg");
}
.img.img-02 {
background-image: url("https://zupimages.net/up/19/51/9fik.jpg");
}
.img.img-03 {
background-image: url("https://zupimages.net/up/19/51/dwq9.jpg");
}
.img-title{
font-size: 20px;
line-height: 1.4;
color: #cd2122;
margin-top: 10px;
margin-left: 20px;
float: left;
font-weight: 700;
font-family: Open Sans;
}
.img-text{
font-family: Open Sans;
font-size: 13px;
line-height: 19px;
color: #535353;
margin-bottom: 20px;
margin-left: 20px;
float: left;
}
<div class="wrapper">
<div class="image-wrapper">
<img class="img-01 img">
<div class="img-title">Trust Management</div>
<div class="img-text">Assets trust management represents one of the most popular operation methods in the world stock markets for companies as well as individuals. Among the advantages of assets trust management we may mention many.</div>
</div>
<div class="image-wrapper">
<img class="img-02 img">
<div class="img-title">Well Documented</div>
<div class="img-text">Assets trust management represents one of the most popular operation methods in the world stock markets for companies as well as individuals. Among the advantages of assets trust management we may mention many.</div>
</div>
<div class="image-wrapper">
<img class="img-03 img">
<div class="img-title">Great Support</div>
<div class="img-text">Assets trust management represents one of the most popular operation methods in the world stock markets for companies as well as individuals. Among the advantages of assets trust management we may mention many.</div>
</div>
</div>
解决方案
推荐阅读
- bash - 删除与 grep 模式匹配的行
- python - SageMaker TF 2.3 分布式训练
- vue.js - 为电子Vue应用程序实现动态主题系统
- c - C 我可以返回数组而不是指针吗?如果不能,我可以使用指针吗?
- cmake - 如何在make期间只编译一组目标
- reactjs - React – 最佳实践 firebase 导入:如何从 firebase.auth 中选择常量?
- ruby - Ruby 错误发生时是否会沿调用链向上传播?变得奇怪的行为
- soap - WSDL2APEx 字段缺失
- javascript - 根据vuejs中的选定值隐藏显示div
- c++ - C++ - 以面向性能的方式读取日志级别