Kamil Waniczek
Kamil Waniczek

Reputation: 67

Div not moving even if there is enough space

I want to make site when i click button profile shows. But i have problem. When i click button profile div is showing under body even if there is enough space. Here is what it looks like: image on imgur

body,
html {
  height: 100%;
  width: 100%;
}

* {
  margin: 0 !important;
  padding: 0 !important;
}

.calendar {
  width: 100%;
  height: 100%;
  background-color: black;
  transition: all .5s;
  border: 0;
  margin: 0;
  padding: 0;
}

.profile {
  height: 100%;
  background-color: white;
  transition: all .5s;
  float: right !important;
  display: none;
}

.close {
  float: right;
  width: 40px;
  height: 40px;
  top: 0px;
  right: 0px;
}
<button class="open">PROFILE</button>

<div class="calendar"></div>

<div class="profile">
  <button class="close">x</button>
</div>

Upvotes: 0

Views: 346

Answers (1)

nah0131
nah0131

Reputation: 329

Add

float: left

to your .calendar-class. This should fix your problem

Upvotes: 2

Related Questions