I have a section on website where different testimonials appear and the div has a background color which appears fine on desktop but if viewed on mobile devices the testimonials text runs longer (vertically) than the background height.
This is the class that is assigned to the div
.quote{
background-color: #f7f7f7 !important;
border: 8px none;
height: 350px;
padding: 15px;
}
Now I know that the height is fixed to 350px
but if I change that to 100%
or auto
that does not work. I need the background to appear as long as the text appears.
If you want the div to be 350px
in height, then you're doing it right. But you will need to add overflow-y: hidden;
or overflow-y: auto
.
However, I do suggest you simply change height
to min-height
if you want the div to grow with the text.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.