gpt4 book ai didi

css - 如何设置类似于名片的文字样式?

转载 作者:行者123 更新时间:2023-11-28 12:38:20 25 4
gpt4 key购买 nike

我需要设计类似名片的东西如下:

My Businesses
Logo AAA Logo BBB
93939393 87878787
10 sample road, city 15 new lane, city
We are the best, contact us for more information. This is another business
We are always here to help. It is always here to help.
Link1 Link2

Other entries go the same.

如您所见,它有一个 Logo ,即图像,然后在其前面是公司名称,下一行是电话,下一行是地址,接下来的几行是对公司的描述。最后,最后一行是指向企业网站的链接。

代码

    .test {
clear: both;
display: block;
margin: 10px auto;
width: 90%;
height: 100%;
max-width: 1400px;
overflow-y: auto;
}
.test ul li {
display: block;
float: left;
height: 240px;
width: 24%;
text-align: center;
border: 1px solid orange;
border-radius: 5px;
padding: 8px;
margin: 4px;
position: relative;
}
<div class="test">
<h2>My Businesses</h2>
<ul>
<li>
<img src="" width="100" height="100" />
<p>AAA
<br/>93939393
<br/>10 sample road, city
<br/>We are the best, contact us for more information. We are always here to help.</br>
Link1</p>
</li>
<li>
<img src="" width="100" height="100" />
<p>BBB
<br/>87878787
<br/>15 new lane, city
<br/>This is another business It is always here to help.</br>
Link2</p>
</li>
<li>
<img src="" width="100" height="100" />
<p>CCC
<br/>12121212
<br/>34 alex avenue, city
<br/>This is the third business. They are also there to help.</br>
Link3</p>
</li>
</ul>
</div>

目前的代码是这样的

    .test {
clear: both;
display: block;
margin: 10px auto;
width: 90%;
height: 100%;
max-width: 1400px;
overflow-y: auto;
}
.test ul li {
display: block;
float: left;
height: 240px;
width: 24%;
text-align: center;
border: 1px solid orange;
border-radius: 5px;
padding: 8px;
margin: 4px;
position: relative;
}
<div class="test">
<h2>My Businesses</h2>
<ul>
<li>
<img src="" width="100" height="100" />
<p>AAA
<br/>93939393
<br/>10 sample road, city
<br/>We are the best, contact us for more information. We are always here to help.</br>
Link1</p>
</li>
<li>
<img src="" width="100" height="100" />
<p>BBB
<br/>87878787
<br/>15 new lane, city
<br/>This is another business It is always here to help.</br>
Link2</p>
</li>
<li>
<img src="" width="100" height="100" />
<p>CCC
<br/>12121212
<br/>34 alex avenue, city
<br/>This is the third business. They are also there to help.</br>
Link3</p>
</li>
</ul>
</div>

        Logo  
AAA
93939393
10 sample road, city We are the best, contact us
for more information.We are always here to help.
Link

最佳答案

jsBin demo

这是 LI 元素中所需 HTML 标记的新示例:

<p>
<img src="//placehold.it/100x100&text=LOGO" width="100" height="100"/>
AAA<br/>
93939393<br/>
10 sample road, city
</p>
<p>
We are the best, contact us for more information.
We are always here to help.</br>
Link1
</p>

CSS:

*{ margin:0; padding:0; } /* GUR Global Ugly Reset */

.test ul {
text-align:center;
}

.test ul li{
text-align:left;
list-style:none;
display:inline-block;
vertical-align:top;
width: 24%;
border: 1px solid orange ;
border-radius: 5px;
padding: 8px;
margin: 4px;
}

.test li p{overflow: hidden; margin: 10px;}
.test p + p{clear: both;}
.test li p img{float: left; margin-right:10px;}

关于css - 如何设置类似于名片的文字样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27180951/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com