I am using semantic UI to create a webpage (No React, NPM or anything fancy, just plain HTML/CSS). I am trying to add modal to my page but it behaves very strange as the modal height is too long. I don't have any other framework like Bootstrap included in my code.
How it behaves:
How it is supposed to behave:
Semantic UI Version: 2.4.2
Is Semantic UI Installed correctly? Yes, other components work.
<div id="myModal" class="ui basic modal">
<div class="ui icon header">
<i class="archive icon"></i>
Archive Old Messages
</div>
<div class="content">
<p>Your inbox is getting full, would you like us to enable automatic archiving of old messages?</p>
</div>
<div class="actions">
<div class="ui red basic cancel inverted button">
<i class="remove icon"></i>
No
</div>
<div class="ui green ok inverted button">
<i class="checkmark icon"></i>
Yes
</div>
</div>
</div>
$('.ui.basic.modal')
.modal('show')
;
#myModal { position: relative;}
and then adding id to my modal, as explained in this answer: https://stackoverflow.com/a/40774996/10934182 body{ max-height: 100vh; }
body{ max-height: 100vh; }
as explained here: semantic-ui modal stretching window height Thanks!!
In your JSfiddle I noticed your div inside of .modal-content
has min-height: 1000px
. I removed this and the modal is normal height now.
This is not the problem with the height of the modal. This is because of the version of 'semantic-ui-css' latest version. You can solve this issue by installing the 2.2.14 version of the semantic-ui-css *
npm install semantic-ui-css@2.2.14
* It did for me and many other. So hope it'll work for you also
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.