Create Responsive div on an Image using css

I have an image slide show with a div ,some text in the div and a button. I need the div and the button to resize and responsive on small scale. My code doesn’t work. Below is my code

1 / 3
Hello we accept any car donation
<div class="wrapper">
    <div class="post-content">
        <h1>My heading test</h1>
        <p style="color: black; font-size: 1.7rem; overflow-wrap: break-word; white-space: normal; font-family: ariel">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    <button type="button" class="button1 button3" onclick="location.href = '@Url.Action("Pay", "Donations")'"><b style="font-size: 18px;">Donate Your Car</b></button>

.slideshow-container { width: 100%; position: relative; display: block;

.post-content {
background: none repeat scroll 0 0 #FFffff;
margin: 0 auto;
margin-top: -140px;
text-align: center;
position: relative;
display: block;
height: 330px;
width: 90%;
border: 2px solid lavender;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 12px;
overflow: hidden;
.wrapper {
text-align: center;

.button1 {
background: none repeat scroll 0 0 #FFffff;
color: blue;
padding: 20px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
left: 1px;
right: 410px;
margin: 4px 2px;
margin-top: -90px;
position: relative;
border: 1.2px solid lightblue;

.button3 {
border-radius: 8px;

Could you give some more information about the problem.
i revised the code and found some mistakes that could be better.

class="button1 button3"

if you see what is doing button3 is just a border-radius, so you can put that on the class button1, and delete button3, in css the class .slideshow-container you are not using it

maybe to get the responsive you could use the % instead of the px or the vw or vh.

If you want this to be responsive then you definitely do not want to set the height on the post-content div in px because then it won’t be able to get taller as you narrow the browser and the text will be cut-off at the bottom. You probably don’t need a height on it at all, but if you really do then you probably want to add the ability for the div to scroll vertically (overflow: auto instead of overflow: hidden), but I’m just guessing because I don’t know what your intent is here.

I’m not sure what you want the button to do on narrower screens?

1 Like

Thanks for your response. You are right . I have set height:0 and padding-bottom:10% and it works .

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.