Skip to content

min-height and height not working correctly #12358

Answered by wongjn
dantuv90 asked this question in Help
Discussion options

You must be logged in to vote

Interesting! So it seems like it works when you don't include <!DOCTYPE html>.
For example, here is your snippet not working with <!DOCTYPE html> added:

<!DOCTYPE html>
<div style="min-height:100vh">
  <div style="height:100%; background-color:blue;"></div>
</div>

and here is the Tailwind version working with no <!DOCTYPE html>:

<div class="min-h-screen">
  <div class="h-full bg-blue-500">
  </div>
</div>

Neither option works in Tailwind Play because it automatically adds <!DOCTYPE html> to the document.

Replies: 13 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@adydetra
Comment options

@wongjn
Comment options

Answer selected by dantuv90
@dantuv90
Comment options

@wongjn
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@nestorbfgo
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
Converted from issue

This discussion was converted from issue #12357 on November 03, 2023 18:30.