Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two divs on same position

Tags:

html

css

I got two divs. The second div should be on first div, so... When clicking at menu buttons in first div, there should appear second div on first div (the second div covers the first one). I created the second div under first one, gave to it relative position, and took it up to first one. But there is a problem. There is an overflow, cause the div is long, and div's height saved at bottom. How to do this thing without any problems?

like image 565
Tigran Avatar asked Nov 30 '22 21:11

Tigran


1 Answers

HTML

<div class='wrapper'>
   <div class='firstDiv'></div>
   <div class='secondDiv'></div>
</div>

CSS

.wrapper{
  position: relative;
}

.firstDiv, .secondDiv{
  position: absolute;
}
like image 54
hobberwickey Avatar answered Dec 03 '22 10:12

hobberwickey