Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

flex button child height not accepting 100 percent #282

Open
nirvparekh opened this issue May 9, 2020 · 1 comment
Open

flex button child height not accepting 100 percent #282

nirvparekh opened this issue May 9, 2020 · 1 comment

Comments

@nirvparekh
Copy link

I am having following html markup

<button class="flex">
  <div class="flex-item">
    Click Me
  </div>
</button>

and css applied:

.flex {
  display: flex;
  width: 100%;
  height: 48px;
  background: black;
  flex-direction: row
}
.flex-item {
  height: 100%;
  background: grey
}

The problem is, parent node is <button> with flex-direction: row, child element does not accept height in percentage.
height in percentage only works if parent node is <div>

@eddsaura
Copy link

eddsaura commented Jun 17, 2020

Why don't you just write on the contrary?

<div><button/></div>

Is there a reason?

Thanks for sharing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants