Image Displaying Behind The Section After Using Overflow Hidden
I am getting the horizontal scroll when using after class. If I use overflow then my image is displaying behind the first section. Would you help me out with these issues? This is
Solution 1:
Problem is
img
isrelative
to that div so it cut, Settingright
0
and width to actual width of img solved that problem
section {
height: 400px;
position: relative;
}
.test1 {
}
.test1:after {
content: "";
background-image: url('https://www.netclipart.com/pp/m/16-165891_sale-price-tag-png-sale-icon-png.png');
background-repeat: no-repeat;
background-size: contain;
width: 210px;
height: 308px;
display: block;
position: absolute;
top: -15%;
right: 0;
background-position: 47px center
}
<sectionstyle="background-color: #f8f8f8;"><p>Lorem ipsum dolor sit amet, consectetur adipisicing 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.</p></section><sectionclass="test1"><p>Lorem ipsum dolor sit amet, consectetur adipisicing 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.
</p></section>
Post a Comment for "Image Displaying Behind The Section After Using Overflow Hidden"