带文本的PNG图像。断路线图像+至少一些文字
嗨,我有一些文字(我使用png文件作为Quoutes)。
问题在于,当您缩小窗口大小时,线路破裂。我试图避免仅使用图像破裂,例如:
.testimonials {
padding: 80px 0;
padding: 60px 0;
position: relative;
}
.testimonials::before {
content: "";
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.testimonials .testimonial-item {
text-align: center;
color: #fff;
}
.testimonials .testimonial-item .testimonial-img {
width: 100px;
border-radius: 50%;
border: 2px solid #fff;
margin: 0 auto;
}
.testimonials .testimonial-item h3 {
font-size: 30px;
font-weight: bold;
margin: 10px 0 5px 0;
color: black;
}
.testimonials .testimonial-item h4 {
font-size: 20px;
color: red;
margin: 0 0 15px 0;
}
.testimonials .testimonial-item .quote-icon-left, .testimonials .testimonial-item .quote-icon-right {
color: rgba(255, 255, 255, 0.6);
font-size: 26px;
}
.testimonials .testimonial-item .quote-icon-left {
display: inline-block;
left: -2px;
position: relative;
top: 5px;
}
.testimonials .testimonial-item .quote-icon-right {
display: inline-block;
right: -2px;
position: relative;
}
.testimonials .testimonial-item p {
font-style: italic;
margin: 0 auto 15px auto;
color: black;
}
@media (min-width: 1024px) {
.testimonials {
background-attachment: fixed;
}
}
@media (min-width: 992px) {
.testimonials .testimonial-item p {
width: 80%;
}
}
<div class="testimonials">
<div class="testimonial-item">
<h3>John</h3>
<h4>Master</h4>
<p>
<img src="https://www.pngall.com/wp-content/uploads/12/Quotes-Mark-Symbol-PNG-Image.png" class="bi bi-quote quote-icon-left" style="max-width:26px;"/>
Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum
<img src="https://www.pngall.com/wp-content/uploads/12/Quotes-Mark-Symbol-PNG-Image.png" class="bi bi-quote quote-icon-right" style="max-width:26px;"/>
</p>
</div>
</div>
Hi I have some text in quoutes (I used png files as quoutes).
The problem is with the line breaking when you shrink down the window size. I am trying to avoid breaking line with image only, like this :
It should only break line with at least some text to the left, like this:
How can I achieve this? Any help would be much appreciated.
.testimonials {
padding: 80px 0;
padding: 60px 0;
position: relative;
}
.testimonials::before {
content: "";
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.testimonials .testimonial-item {
text-align: center;
color: #fff;
}
.testimonials .testimonial-item .testimonial-img {
width: 100px;
border-radius: 50%;
border: 2px solid #fff;
margin: 0 auto;
}
.testimonials .testimonial-item h3 {
font-size: 30px;
font-weight: bold;
margin: 10px 0 5px 0;
color: black;
}
.testimonials .testimonial-item h4 {
font-size: 20px;
color: red;
margin: 0 0 15px 0;
}
.testimonials .testimonial-item .quote-icon-left, .testimonials .testimonial-item .quote-icon-right {
color: rgba(255, 255, 255, 0.6);
font-size: 26px;
}
.testimonials .testimonial-item .quote-icon-left {
display: inline-block;
left: -2px;
position: relative;
top: 5px;
}
.testimonials .testimonial-item .quote-icon-right {
display: inline-block;
right: -2px;
position: relative;
}
.testimonials .testimonial-item p {
font-style: italic;
margin: 0 auto 15px auto;
color: black;
}
@media (min-width: 1024px) {
.testimonials {
background-attachment: fixed;
}
}
@media (min-width: 992px) {
.testimonials .testimonial-item p {
width: 80%;
}
}
<div class="testimonials">
<div class="testimonial-item">
<h3>John</h3>
<h4>Master</h4>
<p>
<img src="https://www.pngall.com/wp-content/uploads/12/Quotes-Mark-Symbol-PNG-Image.png" class="bi bi-quote quote-icon-left" style="max-width:26px;"/>
Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum
<img src="https://www.pngall.com/wp-content/uploads/12/Quotes-Mark-Symbol-PNG-Image.png" class="bi bi-quote quote-icon-right" style="max-width:26px;"/>
</p>
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只是根据帖子找到了一个ASNWER: keep&lt; img&gt; img&gt; ;始终在文本行的末尾
我们必须将最后一个单词与
&lt; span&gt;/span&gt;
元素中的图像结合起来。然后给它一个白空间:NowRap
样式。I just figured out an asnwer based on post : Keep <img> always at the end of text line
We have to combine last word with the image in the
<span></span>
element. Then give it awhite-space:nowrap
styling.