Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
Div has 0 height on mobile

I have 3 divs that are arranged in a row using bootstrap

 <div className="tile col-sm-4"> 
      <img src='./cabnets.jpg' alt="wood" />
      <div className="text">
      <h1>Superior Cabniets</h1>
      <h2 className="animate-text">More lorem ipsum bacon ipsum.</h2>
      <p className="animate-text">Bacon ipsum dolor amet pork belly tri-tip turducken, pancetta bresaola pork chicken meatloaf. Flank sirloin strip steak prosciutto kevin turducken. </p>
  
      </div>
     </div>

I am styling them with css to provide a hover effect with the following css

.tile
{
 
  height:30rem;
  background-color:#99aeff;
  display:inline-block;
  background-size:cover;
  position:relative;
  cursor:pointer;
  transition: all 0.4s ease-out;
  box-shadow: 0px 35px 77px -17px rgba(0,0,0,0.44);
  overflow:hidden;
  color:white;
  font-family:'Roboto';
  
}
.tile img
{
  height:100%;
  width:100%;
  position: absolute; /* not appearing on mobile */ 
  top:0;
  left:0;
  transition: all 0.4s ease-out;
}
.tile .text
{
   z-index:5; 
  position:absolute;
  padding:30px;
  height:calc(100% - 60px);
}

I am expecting them to collapse on top of each other for mobile screens, however instead they have completely disappeared. I have checked the developer tools and I see on mobile my divs are still there but their height is 0. height-0
I have no css breakpoints in my code, or any other code that affects the .tile class. Full sized screens show the 3 divs perfectly.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I think that image already has a height. What it doesn't have is "width". Try adding col-12 or col-xs-12 to the .tile depending on the bootstrap version you are using.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!