我正在尝试让我的blockquote看起来像附加的图像。我有顶部和底部的渐变,但我被困在左右边界,我不知道如何更多地围绕报价。另外,我想知道如何在右侧连接到图片。谢谢你的帮助!
这是我到目前为止所拥有的
/*-------Testimonial Section Styles---------*/
section#testimonial-section {
height: 300px;
margin-top: 100px;
width: 100%;
}
/*------Block Quote Sttyles-------*/
.testimonial-paragraph-wrapper {
width: 100%;
padding: 20px;
margin: 10px auto;
text-align: center;
}
.testimonial-border {
display: inline;
margin-left: 117px;
float: left;
}
blockquote {
width: 100%;
padding: 36px 50px;
position: relative;
background: transparent;
margin-bottom: 0px;
/* gradient shining border */
background-image: linear-gradient(to left, rgba(108, 178, 61, 1) 100%, rgba(108, 178, 61, 1) 100%, rgba(108, 178, 61, 1) 100%), linear-gradient(to left, rgba(108, 178, 61, 1) 100%, rgba(108, 178, 61, 1) 100%, rgba(108, 178, 61, 1) 100%);
background-size: 90% 5px;
background-position: 100% 0%, -510% 100%;
background-repeat: no-repeat;
border-left: 5px solid rgba(108, 178, 61, 1);
border-right: 5px solid rgba(108, 178, 61, 1);
}
cite {
font-style: normal;
text-align: right;
float: right;
padding-right: 100px;
padding-top: 20px;
}
blockquote::before,
article blockquote::after {
top: 0;
bottom: 0;
width: 25px;
content: '';
position: absolute;
background: #61a036;
-webkit-box-shadow: 0 2px rgba(0, 0, 0, 0.25);
box-shadow: 0 2px rgba(0, 0, 0, 0.25);
}
blockquote::before {
right: 100%;
}
blockquote::after {
left: 100%;
}
blockquote p {
font-size: 20px;
line-height: 1.5em;
margin-bottom: 28px;
color: #61a036;
padding-left: 40px;
padding-right: 40px;
}
blockquote p::before {
top: 0;
left: -33px;
color: #61a036;
content: '“';
font-size: 10em;
position: absolute;
text-shadow: -3px 0 #000;
padding-top: 0px;
}
blockquote p::after {
right: 16px;
color: #61a036;
content: '”';
bottom: -32px;
font-size: 10em;
position: absolute;
text-shadow: 3px 0 #000;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<section id="testimonial-section">
<div class="container">
<div class="row">
<div class="col-md-8 text-center">
<div class="testimonial-wrapper">
<div id="testimonial-border" class="testimonial-paragraph-wrapper">
<blockquote>
<p class="blockquote-text">My son had to go to the doctor’s office and my insurance didn’t pay for some of it, and rent was due ... then I looked at the calendar...I was going to be getting a big payment from FusionCash in only 3 more days, straight to my PayPal®
account!</p>
<cite>- John Hughes of Grants Pass, OR</cite>
</blockquote>
</div>
</div>
</div>
<div class="col-md-4 pull-right">
<div class="testimonial-img-wrapper">
<img class=" testimonial-img" src="http://res.cloudinary.com/alexscloud1234/image/upload/c_scale,w_200/v1516656363/ryan-fields-328391_lxjslk.png">
</div>
</div>
</div>
</div>
</section>
答案 0 :(得分:0)
可以使用flexbox轻松完成连接线,只需在容器上使用伪元素,并使用order
调整位置。
(我从等式中取出了引导程序,以简化事情......根据需要进行调整)
/*-------Testimonial Section Styles---------*/
#testimonial-section{
margin:20px;
display:flex;
align-items:center;
position:relative;
}
#testimonial-section:before{
content:"";
height:4px;
flex:1 1 10%;
background:#61a036;
}
.testimonial-img{
flex:1 1 20%;
border:4px solid #61a036;
border-radius:50%; padding:10px;
display:inline-block;
height:100%;
}
#testimonial-section blockquote{
margin:0;
border:4px solid #61a036;
flex:1 1 70%;
position:relative;
color: #61a036;
font-size:1.5em;
font-family:sans-serif;
order:-1;
}
#testimonial-section blockquote:before, #testimonial-section blockquote:after{
text-align:center;
background:white;
position:absolute;
font-size:8rem;
width:4rem; height:5rem;
}
#testimonial-section blockquote:before{
content:"“";
top:-2rem;
left:-2rem;
}
#testimonial-section blockquote:after{
content:"”";
bottom:-2rem;
right:-2rem;
}
.blockquote-text{
padding:1em;
}
cite{
font-size:1rem;
position:relative;
top:0.5rem;
background:white;
float:right;
}
<section id="testimonial-section">
<blockquote>
<p class="blockquote-text">My son had to go to the doctor’s office and my insurance didn’t pay for some of it, and rent was due ... then I looked at the calendar...I was going to be getting a big payment from FusionCash in only 3 more days, straight to my PayPal® account!</p>
<cite>- John Hughes of Grants Pass, OR</cite>
</blockquote>
<img class="testimonial-img" src="http://res.cloudinary.com/alexscloud1234/image/upload/c_scale,w_200/v1516656363/ryan-fields-328391_lxjslk.png">
</section>
其余的应该只是定位。