How to make a popup in HTML? Different methods - Installation & Integration - Popupsmart Community
how to make a popup box using html code - Stack Overflow
How to create an HTML pop up with minimal to no JavaScript - Stack Overflow
pop up window using html/CSS and javascript
Change '.profileStyle' to '.style' maybe?
More on reddit.comVideos
Nowadays, we can do that without JavaScript nor CSS by using the Popover API.
<button popovertarget="mypopover">Toggle the popover</button>
<dialog id="mypopover" popover>Popover content</dialog>
References:
- Example: https://mdn.github.io/dom-examples/popover-api/blur-background/
Yes, you can do this in pure HTML and CSS. The trick is to use the :target pseudo selector. Rules with :target will match when the URL anchor matches a particular ID. You can update the URL anchor by creating a plain anchor link. This does have a slight jumping effect because we're using anchors, but it is possible.
So for example: http://jsfiddle.net/X49zJ/1/
#modal {
display: none;
width: 300px;
height: 100px;
border: 1px solid #CCC;
background: #EEE;
}
#modal:target {
display: block;
}
<a href="#modal">Click to Trigger The Modal</a>
<div id="modal"> I am a Hidden Modal</div>
See https://developer.mozilla.org/en-US/docs/Web/CSS/:target for more information on the :target and also this demo for a much prettier lightbox.
For more flexibility, you can always add JavaScript. If your JavaScript is non-essential, it's generally best practice to put JavaScript at the bottom of the body, or add the script tag with the async attribute so it doesn't pause rendering of content when it loads.