Created
May 18, 2016 19:49
-
-
Save nate-strauser/530e40ee3bb9b5bb35d366b26e5e1331 to your computer and use it in GitHub Desktop.
How to have a fixed modal header with materializecss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Modal Markup: | |
<div class="modal modal-fixed-header"> | |
<div class="modal-header"> | |
HEADER CONTENT | |
</div> | |
<div class="modal-content"> | |
MAIN CONTENT | |
</div> | |
</div> | |
LESS Styling: | |
.modal { | |
background-color: #fff; | |
&.modal-fixed-header { | |
padding: 0; | |
height: 70%; | |
.modal-header { | |
border-top: 1px solid rgba(0, 0, 0, 0.1); | |
position: absolute; | |
top: 0; | |
} | |
.modal-header { | |
border-radius: 0 0 2px 2px; | |
//background-color: #fafafa; | |
padding: 4px 6px; | |
height: 56px; | |
width: 100%; | |
} | |
.modal-content { | |
position: absolute; | |
top:56px; | |
height: calc(100% - 56px); | |
max-height: 100%; | |
width: 100%; | |
overflow-y: auto; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment