logo
Tags down

shadow

overlay div on div


By : jonathan mem
Date : May 07 2020, 08:39 AM

need help ,my content is overlap in bottom padding area i want space bottom and top but top space working fine but bottom padding area is overlapping content.

what is solution for fix  this type of issue. also suggestion to me scroll content area when enter large text in box. i have also attachment of overlapping image plase check.

Thanks in Advance.

enter image description here

* {
  box-sizing: border-box;
}

.box {                
  width: 400px;
  height: 200px;
  margin: 0 auto;
  position: relative;
}
img {
  max-width: 100%;
}
.content {
  position: absolute;
  height: 100%;
  bottom: 20px;
  padding: 15px;
  overflow: hidden;
  left: 0;
  background-color: rgba(0,0,0,0.5);
  color: #fff;
  top: 0;
}
.content p {
  margin-bottom: 0;
}
<section class="features-box-style">
  <div class="box">
    <div class="image">
      <img src="http://placekitten.com/1000/500" alt="" />
    </div>
    <div class="content">
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer</p>
    </div>
  </div>
</section>

Answer :

 you can easily consider transparent border instead of padding code like :

* {
  box-sizing: border-box;
}

.box {                
  width: 400px;
  height: 200px;
  margin: 0 auto;
  position: relative;
}
img {
  max-width: 100%;
}
.content {
  position: absolute;
  bottom:0;
  left: 0;
  right:0;
  top: 0;
  border: 15px solid transparent;
  overflow: hidden;
  background-color: rgba(0,0,0,0.5);
  color: #fff;
}
.content p {
  margin: 0;
}
<section class="features-box-style">
  <div class="box">
    <div class="image">
      <img src="http://placekitten.com/1000/500" alt="" />
    </div>
    <div class="content">
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer</p>
    </div>
  </div>
</section>



Share : facebook icon twitter icon
Related Posts Related Posts :
  • clear array after form submit
  • pass url variable to javascript
  • access data using api
  • div position fixed css
  • add horizontal line between two div
  • disable toggle button css
  • css fixed line height
  • background image not working
  • table cell border
  • text line break css
  • text direction rtl css
  • javascript convert string to an object
  • bind inner div click to outer div
  • jquery ajax oncomplete
  • how to use promise in for loop
  • jquery get element using variable
  • javascript send textbox value
  • pass div class content to another class or id
  • css new line after element
  • css calc not working properly
  • link disabled jquery
  • sql join table to subquery
  • MS Access SQL Issue with OR AND Operators
  • set textarea value using php
  • php merge two arrays into one
  • php form with google captcha
  • update current row in php
  • php date format mysql
  • mysql pdo select query
  • php function return an array
  • PHP mysqldump database to sql file
  • display image query
  • php create array using foreach loop
  • associative array php
  • group_concat in mysql laravel
  • php array_push empty
  • mysql on update cascade not working
  • pdo insert prepared statement
  • mysql insert ignore vs on duplicate key
  • mysql insert into existing row
  • mysql multi insert query
  • mysql group by show all rows
  • php change profile image
  • combine multiple arrays into one array php
  • how to sum values in an array
  • how to get sum of the total time
  • How to Create Facebook live stream without notification using API ?
  • on button click make div visible
  • css affect another element on hover
  • insert line after paragraph word
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org