How to keep focus within modal dialog?

Edit February 1, 2024: The inert attribute is now fully stable and can be used to prevent a user escaping a modal by making everything outside the modal inert. Additionally, you can use the dialog element with the showModal function to handle modal dialog focus automatically. Using showModal will open the dialog element as a … Read more

How to use Semantic UI CDN?

You just need to copy the URL of the files you want to use for Semantic UI, and put it in your header under a script or link tag as the “src” or “href” value. For Semantic UI, you need three files for general use: semantic.min.css jquery.min.js (from JQuery CDN) semantic.min.js For example: <!DOCTYPE HTML> … Read more

Center div on the middle of screen [duplicate]

This should work with any div or screen size: .center-screen { display: flex; justify-content: center; align-items: center; text-align: center; min-height: 100vh; } <html> <head> </head> <body> <div class=”center-screen”> I’m in the center </div> </body> </html> See more details about flex here. This should work on most of the browsers, see compatibility matrix here. Update: If … Read more

Semantic-ui vs Bootstrap [closed]

I think that we can’t see the differences between Bootstrap and Semantic-UI right now, Semantic-ui is new, so we have to let the time decide 🙂 My opinion: Semantic-UI design is better than Bootstrap and more clean, easy to use, strict coding, useful components, lightweight. I see the future of Frameworks in Semantic-UI, so I … Read more

How to import jquery using ES6 syntax?

index.js import {$,jQuery} from ‘jquery’; // export for others scripts to use window.$ = $; window.jQuery = jQuery; First, as @nem suggested in comment, the import should be done from node_modules/: Well, importing from dist/ doesn’t make sense since that is your distribution folder with production ready app. Building your app should take what’s inside … Read more

tech