{"id":474,"date":"2025-06-02T20:40:00","date_gmt":"2025-06-02T17:40:00","guid":{"rendered":"https:\/\/html-online.com\/articles\/?p=474"},"modified":"2025-07-06T17:00:26","modified_gmt":"2025-07-06T14:00:26","slug":"simple-popup-box","status":"publish","type":"post","link":"https:\/\/html-online.com\/articles\/simple-popup-box\/","title":{"rendered":"A Very Simple Popup Box &#8211; HTML, CSS, JavaScript"},"content":{"rendered":"<p>Popup boxes are the most useful way of showing a warning or any other important information to the website visitors in many <a href=\"https:\/\/html5-templates.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">HTML5 templates<\/a>. In this article I&#8217;m going to walk you through the creation of a very simple popup box with shadow overlay and close button. We&#8217;re going to implement this using <a href=\"https:\/\/html-css-js.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">HTML, CSS and jQuery<\/a> in less than 100 lines (not compressed code).<\/p>\n<p class=\"aligncenter\">\n<a href=\"\/demo\/popup-box\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/11\/simple-popup-box.jpg\" alt=\"simple popup box html css js\"><br \/>\nOpen the demo in a new page<\/a><\/p>\n<p><!--more--><br \/>\nThe box and the shadow is hidden when the page loads, we have to trigger an event, like a link click to show it.<br \/>\nUse the iframe below to test the <strong>live demo<\/strong>:<br \/>\n<iframe loading=\"lazy\" style=\"width: 100%; height: 300px; overflow: hidden;\" src=\"https:\/\/html-online.com\/demo\/popup-box\/\" width=\"300\" height=\"300\" scrolling=\"no\"><\/iframe><\/p>\n<h2>The HTML Code<\/h2>\n<p>Add a link that triggers the box and a div that behaves like <a href=\"https:\/\/html-css-js.com\/css\/generator\/box-shadow\/\" target=\"_blank\" rel=\"noopener noreferrer\">the box shadow<\/a>. This wraps the actual box with the close button. The <em>helper<\/em> span is used to center the box vertically.<\/p>\n<pre style=\"background: #fff; color: #000;\"><span style=\"color: #1c02ff;\">&lt;<span style=\"font-weight: bold;\">a<\/span> <span style=\"font-style: italic;\">class<\/span>=<span style=\"color: #d80800;\">\"trigger_popup_fricc\"<\/span>&gt;<\/span>Click here to show the popup<span style=\"color: #1c02ff;\">&lt;\/<span style=\"font-weight: bold;\">a<\/span>&gt;<\/span>\n\n<span style=\"color: #1c02ff;\">&lt;<span style=\"font-weight: bold;\">div<\/span> <span style=\"font-style: italic;\">class<\/span>=<span style=\"color: #d80800;\">\"hover_bkgr_fricc\"<\/span>&gt;<\/span>\n    <span style=\"color: #1c02ff;\">&lt;<span style=\"font-weight: bold;\">span<\/span> <span style=\"font-style: italic;\">class<\/span>=<span style=\"color: #d80800;\">\"helper\"<\/span>&gt;&lt;\/<span style=\"font-weight: bold;\">span<\/span>&gt;<\/span>\n    <span style=\"color: #1c02ff;\">&lt;<span style=\"font-weight: bold;\">div<\/span>&gt;<\/span>\n        <span style=\"color: #1c02ff;\">&lt;<span style=\"font-weight: bold;\">div<\/span> <span style=\"font-style: italic;\">class<\/span>=<span style=\"color: #d80800;\">\"popupCloseButton\"<\/span>&gt;<\/span>&amp;times;<span style=\"color: #1c02ff;\">&lt;\/<span style=\"font-weight: bold;\">div<\/span>&gt;<\/span>\n        <span style=\"color: #1c02ff;\">&lt;<span style=\"font-weight: bold;\">p<\/span>&gt;<\/span>Add any HTML content<span style=\"color: #1c02ff;\">&lt;<span style=\"font-weight: bold;\">br<\/span> \/&gt;<\/span>inside the popup box!<span style=\"color: #1c02ff;\">&lt;\/<span style=\"font-weight: bold;\">p<\/span>&gt;<\/span>\n    <span style=\"color: #1c02ff;\">&lt;\/<span style=\"font-weight: bold;\">div<\/span>&gt;<\/span>\n<span style=\"color: #1c02ff;\">&lt;\/<span style=\"font-weight: bold;\">div<\/span>&gt;<\/span>\n<\/pre>\n<h2>The CSS Code<\/h2>\n<pre style=\"background: #fff; color: #000;\"><span style=\"color: #00b418;\">\/* Popup box BEGIN *\/<\/span>\n<span style=\"font-style: italic;\">.hover_bkgr_fricc<\/span>{\n    <span style=\"color: #6d79de; font-weight: bold;\">background<\/span>:<span style=\"color: #3c4c72; font-weight: bold;\">rgba<\/span>(<span style=\"color: #c5060b; font-style: italic;\">0,0,0,.4<\/span>);\n    <span style=\"color: #6d79de; font-weight: bold;\">cursor<\/span>:<span style=\"color: #06960e; font-weight: bold;\">pointer<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">display<\/span>:<span style=\"color: #06960e; font-weight: bold;\">none<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">height<\/span>:<span style=\"color: #cd0000; font-style: italic;\">100<span style=\"color: #0100b6; font-weight: bold;\">%<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">position<\/span>:<span style=\"color: #06960e; font-weight: bold;\">fixed<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">text-align<\/span>:<span style=\"color: #06960e; font-weight: bold;\">center<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">top<\/span>:<span style=\"color: #cd0000; font-style: italic;\">0<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">width<\/span>:<span style=\"color: #cd0000; font-style: italic;\">100<span style=\"color: #0100b6; font-weight: bold;\">%<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">z-index<\/span>:<span style=\"color: #cd0000; font-style: italic;\">10000<\/span>;\n}\n<span style=\"font-style: italic;\">.hover_bkgr_fricc<\/span> <span style=\"font-style: italic;\">.helper<\/span>{\n    <span style=\"color: #6d79de; font-weight: bold;\">display<\/span>:<span style=\"color: #06960e; font-weight: bold;\">inline-block<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">height<\/span>:<span style=\"color: #cd0000; font-style: italic;\">100<span style=\"color: #0100b6; font-weight: bold;\">%<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">vertical-align<\/span>:<span style=\"color: #06960e; font-weight: bold;\">middle<\/span>;\n}\n<span style=\"font-style: italic;\">.hover_bkgr_fricc<\/span> &gt; <span style=\"font-weight: bold;\">div<\/span> {\n    <span style=\"color: #6d79de; font-weight: bold;\">background-color<\/span>: <span style=\"color: #c5060b; font-style: italic;\">#fff<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">box-shadow<\/span>: <span style=\"color: #cd0000; font-style: italic;\">10<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span> <span style=\"color: #cd0000; font-style: italic;\">10<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span> <span style=\"color: #cd0000; font-style: italic;\">60<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span> <span style=\"color: #c5060b; font-style: italic;\">#555<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">display<\/span>: <span style=\"color: #06960e; font-weight: bold;\">inline-block<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">height<\/span>: <span style=\"color: #06960e; font-weight: bold;\">auto<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">max-width<\/span>: <span style=\"color: #cd0000; font-style: italic;\">551<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">min-height<\/span>: <span style=\"color: #cd0000; font-style: italic;\">100<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">vertical-align<\/span>: <span style=\"color: #06960e; font-weight: bold;\">middle<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">width<\/span>: <span style=\"color: #cd0000; font-style: italic;\">60<span style=\"color: #0100b6; font-weight: bold;\">%<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">position<\/span>: <span style=\"color: #06960e; font-weight: bold;\">relative<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">border-radius<\/span>: <span style=\"color: #cd0000; font-style: italic;\">8<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">padding<\/span>: <span style=\"color: #cd0000; font-style: italic;\">15<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span> <span style=\"color: #cd0000; font-style: italic;\">5<span style=\"color: #0100b6; font-weight: bold;\">%<\/span><\/span>;\n}\n<span style=\"font-style: italic;\">.popupCloseButton<\/span> {\n    <span style=\"color: #6d79de; font-weight: bold;\">background-color<\/span>: <span style=\"color: #c5060b; font-style: italic;\">#fff<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">border<\/span>: <span style=\"color: #cd0000; font-style: italic;\">3<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span> <span style=\"color: #06960e; font-weight: bold;\">solid<\/span> <span style=\"color: #c5060b; font-style: italic;\">#999<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">border-radius<\/span>: <span style=\"color: #cd0000; font-style: italic;\">50<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">cursor<\/span>: <span style=\"color: #06960e; font-weight: bold;\">pointer<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">display<\/span>: <span style=\"color: #06960e; font-weight: bold;\">inline-block<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">font-family<\/span>: <span style=\"color: #06960e; font-weight: bold;\">arial<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">font-weight<\/span>: <span style=\"color: #06960e; font-weight: bold;\">bold<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">position<\/span>: <span style=\"color: #06960e; font-weight: bold;\">absolute<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">top<\/span>: <span style=\"color: #cd0000; font-style: italic;\">-20<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">right<\/span>: <span style=\"color: #cd0000; font-style: italic;\">-20<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">font-size<\/span>: <span style=\"color: #cd0000; font-style: italic;\">25<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">line-height<\/span>: <span style=\"color: #cd0000; font-style: italic;\">30<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">width<\/span>: <span style=\"color: #cd0000; font-style: italic;\">30<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">height<\/span>: <span style=\"color: #cd0000; font-style: italic;\">30<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">text-align<\/span>: <span style=\"color: #06960e; font-weight: bold;\">center<\/span>;\n}\n<span style=\"font-style: italic;\">.popupCloseButton<\/span><span style=\"font-style: italic;\">:hover<\/span> {\n    <span style=\"color: #6d79de; font-weight: bold;\">background-color<\/span>: <span style=\"color: #c5060b; font-style: italic;\">#ccc<\/span>;\n}\n<span style=\"font-style: italic;\">.trigger_popup_fricc<\/span> {\n    <span style=\"color: #6d79de; font-weight: bold;\">cursor<\/span>: <span style=\"color: #06960e; font-weight: bold;\">pointer<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">font-size<\/span>: <span style=\"color: #cd0000; font-style: italic;\">20<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">margin<\/span>: <span style=\"color: #cd0000; font-style: italic;\">20<span style=\"color: #0100b6; font-weight: bold;\">px<\/span><\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">display<\/span>: <span style=\"color: #06960e; font-weight: bold;\">inline-block<\/span>;\n    <span style=\"color: #6d79de; font-weight: bold;\">font-weight<\/span>: <span style=\"color: #06960e; font-weight: bold;\">bold<\/span>;\n}\n<span style=\"color: #00b418;\">\/* Popup box BEGIN *\/<\/span>\n<\/pre>\n<h2>The Script<\/h2>\n<pre style=\"background:#fff;color:#000\"><span style=\"color:#687687\">$<\/span>(<span style=\"color:#6d79de;font-weight:700\">window<\/span>).<span style=\"color:#3c4c72;font-weight:700\">load<\/span>(function () {\n    <span style=\"color:#687687\">$<\/span>(<span style=\"color:#d80800\">\".trigger_popup_fricc\"<\/span>).<span style=\"color:#3c4c72;font-weight:700\">click<\/span>(function(){\n       <span style=\"color:#687687\">$<\/span>(<span style=\"color:#d80800\">'.hover_bkgr_fricc'<\/span>).show();\n    });\n    <span style=\"color:#687687\">$<\/span>(<span style=\"color:#d80800\">'.hover_bkgr_fricc'<\/span>).<span style=\"color:#3c4c72;font-weight:700\">click<\/span>(function(){\n        <span style=\"color:#687687\">$<\/span>(<span style=\"color:#d80800\">'.hover_bkgr_fricc'<\/span>).hide();\n    });\n    <span style=\"color:#687687\">$<\/span>(<span style=\"color:#d80800\">'.popupCloseButton'<\/span>).<span style=\"color:#3c4c72;font-weight:700\">click<\/span>(function(){\n        <span style=\"color:#687687\">$<\/span>(<span style=\"color:#d80800\">'.hover_bkgr_fricc'<\/span>).hide();\n    });\n});\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Popup boxes are the most useful way of showing a warning or any other important information to the website visitors in many HTML5 templates. In this article I&#8217;m going to walk you through the creation of a very simple popup box with shadow overlay and close button. We&#8217;re going to implement this using HTML, CSS &hellip; <a href=\"https:\/\/html-online.com\/articles\/simple-popup-box\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;A Very Simple Popup Box &#8211; HTML, CSS, JavaScript&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2,4,5,6],"tags":[],"class_list":["post-474","post","type-post","status-publish","format-standard","hentry","category-articles","category-css","category-html","category-javascript","category-jquery"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A Very Simple Popup Box - HTML, CSS, JavaScript<\/title>\n<meta name=\"description\" content=\"In this article I&#039;m going to walk you through the creation of a very simple popup box with shadow overlay and close button.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/html-online.com\/articles\/simple-popup-box\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Very Simple Popup Box - HTML, CSS, JavaScript\" \/>\n<meta property=\"og:description\" content=\"In this article I&#039;m going to walk you through the creation of a very simple popup box with shadow overlay and close button.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/html-online.com\/articles\/simple-popup-box\/\" \/>\n<meta property=\"og:site_name\" content=\"HTML Online\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/htmlcoding\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-02T17:40:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-06T14:00:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/11\/simple-popup-box.jpg\" \/>\n<meta name=\"author\" content=\"HTML Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"HTML Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/html-online.com\/articles\/simple-popup-box\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/html-online.com\/articles\/simple-popup-box\/\"},\"author\":{\"name\":\"HTML Editor\",\"@id\":\"https:\/\/html-online.com\/articles\/#\/schema\/person\/019f9afa07f209153df0fecfc90b8c1d\"},\"headline\":\"A Very Simple Popup Box &#8211; HTML, CSS, JavaScript\",\"datePublished\":\"2025-06-02T17:40:00+00:00\",\"dateModified\":\"2025-07-06T14:00:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/html-online.com\/articles\/simple-popup-box\/\"},\"wordCount\":158,\"publisher\":{\"@id\":\"https:\/\/html-online.com\/articles\/#organization\"},\"image\":{\"@id\":\"https:\/\/html-online.com\/articles\/simple-popup-box\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/11\/simple-popup-box.jpg\",\"articleSection\":[\"Articles\",\"CSS\",\"HTML\",\"JavaScript\",\"jQuery\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/html-online.com\/articles\/simple-popup-box\/\",\"url\":\"https:\/\/html-online.com\/articles\/simple-popup-box\/\",\"name\":\"A Very Simple Popup Box - HTML, CSS, JavaScript\",\"isPartOf\":{\"@id\":\"https:\/\/html-online.com\/articles\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/html-online.com\/articles\/simple-popup-box\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/html-online.com\/articles\/simple-popup-box\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/11\/simple-popup-box.jpg\",\"datePublished\":\"2025-06-02T17:40:00+00:00\",\"dateModified\":\"2025-07-06T14:00:26+00:00\",\"description\":\"In this article I'm going to walk you through the creation of a very simple popup box with shadow overlay and close button.\",\"breadcrumb\":{\"@id\":\"https:\/\/html-online.com\/articles\/simple-popup-box\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/html-online.com\/articles\/simple-popup-box\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/html-online.com\/articles\/simple-popup-box\/#primaryimage\",\"url\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/11\/simple-popup-box.jpg\",\"contentUrl\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/11\/simple-popup-box.jpg\",\"width\":535,\"height\":223,\"caption\":\"simple popup box html css js\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/html-online.com\/articles\/simple-popup-box\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/html-online.com\/articles\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Very Simple Popup Box &#8211; HTML, CSS, JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/html-online.com\/articles\/#website\",\"url\":\"https:\/\/html-online.com\/articles\/\",\"name\":\"HTML Online Articles\",\"description\":\"Tips, tricks, tutorials\u2026\",\"publisher\":{\"@id\":\"https:\/\/html-online.com\/articles\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/html-online.com\/articles\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/html-online.com\/articles\/#organization\",\"name\":\"HTML Online\",\"url\":\"https:\/\/html-online.com\/articles\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/html-online.com\/articles\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2022\/06\/logo.jpg\",\"contentUrl\":\"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2022\/06\/logo.jpg\",\"width\":350,\"height\":350,\"caption\":\"HTML Online\"},\"image\":{\"@id\":\"https:\/\/html-online.com\/articles\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/htmlcoding\/\",\"https:\/\/www.linkedin.com\/in\/ferencdenes\/\",\"https:\/\/www.youtube.com\/channel\/UCn38Jw1sJzbjVHO95Zp0Sww\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/html-online.com\/articles\/#\/schema\/person\/019f9afa07f209153df0fecfc90b8c1d\",\"name\":\"HTML Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/html-online.com\/articles\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7c1d8f5e7f1dc3e261766a96ac50c6a907fa5c236e87ab73379c57c9114e92cd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7c1d8f5e7f1dc3e261766a96ac50c6a907fa5c236e87ab73379c57c9114e92cd?s=96&d=mm&r=g\",\"caption\":\"HTML Editor\"},\"description\":\"In 2013, while wrestling with a mountain of client articles and an uncooperative CMS, I decided enough was enough. So, I created an online HTML editor purely out of necessity (and mild frustration). What began as a tool for my own sanity quickly evolved into a gift for the world\u2014or at least for anyone trying to avoid breaking their website's code. Since then, I've shared my tech notes on my blog, which serves as both a handy reference and a digital diary of the adventures and misadventures of a coder.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/ferencdenes\/\",\"https:\/\/www.youtube.com\/@htmlg\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Very Simple Popup Box - HTML, CSS, JavaScript","description":"In this article I'm going to walk you through the creation of a very simple popup box with shadow overlay and close button.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/html-online.com\/articles\/simple-popup-box\/","og_locale":"en_GB","og_type":"article","og_title":"A Very Simple Popup Box - HTML, CSS, JavaScript","og_description":"In this article I'm going to walk you through the creation of a very simple popup box with shadow overlay and close button.","og_url":"https:\/\/html-online.com\/articles\/simple-popup-box\/","og_site_name":"HTML Online","article_publisher":"https:\/\/www.facebook.com\/htmlcoding\/","article_published_time":"2025-06-02T17:40:00+00:00","article_modified_time":"2025-07-06T14:00:26+00:00","og_image":[{"url":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/11\/simple-popup-box.jpg","type":"","width":"","height":""}],"author":"HTML Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"HTML Editor","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/html-online.com\/articles\/simple-popup-box\/#article","isPartOf":{"@id":"https:\/\/html-online.com\/articles\/simple-popup-box\/"},"author":{"name":"HTML Editor","@id":"https:\/\/html-online.com\/articles\/#\/schema\/person\/019f9afa07f209153df0fecfc90b8c1d"},"headline":"A Very Simple Popup Box &#8211; HTML, CSS, JavaScript","datePublished":"2025-06-02T17:40:00+00:00","dateModified":"2025-07-06T14:00:26+00:00","mainEntityOfPage":{"@id":"https:\/\/html-online.com\/articles\/simple-popup-box\/"},"wordCount":158,"publisher":{"@id":"https:\/\/html-online.com\/articles\/#organization"},"image":{"@id":"https:\/\/html-online.com\/articles\/simple-popup-box\/#primaryimage"},"thumbnailUrl":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/11\/simple-popup-box.jpg","articleSection":["Articles","CSS","HTML","JavaScript","jQuery"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/html-online.com\/articles\/simple-popup-box\/","url":"https:\/\/html-online.com\/articles\/simple-popup-box\/","name":"A Very Simple Popup Box - HTML, CSS, JavaScript","isPartOf":{"@id":"https:\/\/html-online.com\/articles\/#website"},"primaryImageOfPage":{"@id":"https:\/\/html-online.com\/articles\/simple-popup-box\/#primaryimage"},"image":{"@id":"https:\/\/html-online.com\/articles\/simple-popup-box\/#primaryimage"},"thumbnailUrl":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/11\/simple-popup-box.jpg","datePublished":"2025-06-02T17:40:00+00:00","dateModified":"2025-07-06T14:00:26+00:00","description":"In this article I'm going to walk you through the creation of a very simple popup box with shadow overlay and close button.","breadcrumb":{"@id":"https:\/\/html-online.com\/articles\/simple-popup-box\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/html-online.com\/articles\/simple-popup-box\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/html-online.com\/articles\/simple-popup-box\/#primaryimage","url":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/11\/simple-popup-box.jpg","contentUrl":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2017\/11\/simple-popup-box.jpg","width":535,"height":223,"caption":"simple popup box html css js"},{"@type":"BreadcrumbList","@id":"https:\/\/html-online.com\/articles\/simple-popup-box\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/html-online.com\/articles\/"},{"@type":"ListItem","position":2,"name":"A Very Simple Popup Box &#8211; HTML, CSS, JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/html-online.com\/articles\/#website","url":"https:\/\/html-online.com\/articles\/","name":"HTML Online Articles","description":"Tips, tricks, tutorials\u2026","publisher":{"@id":"https:\/\/html-online.com\/articles\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/html-online.com\/articles\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/html-online.com\/articles\/#organization","name":"HTML Online","url":"https:\/\/html-online.com\/articles\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/html-online.com\/articles\/#\/schema\/logo\/image\/","url":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2022\/06\/logo.jpg","contentUrl":"https:\/\/html-online.com\/articles\/wp-content\/uploads\/2022\/06\/logo.jpg","width":350,"height":350,"caption":"HTML Online"},"image":{"@id":"https:\/\/html-online.com\/articles\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/htmlcoding\/","https:\/\/www.linkedin.com\/in\/ferencdenes\/","https:\/\/www.youtube.com\/channel\/UCn38Jw1sJzbjVHO95Zp0Sww"]},{"@type":"Person","@id":"https:\/\/html-online.com\/articles\/#\/schema\/person\/019f9afa07f209153df0fecfc90b8c1d","name":"HTML Editor","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/html-online.com\/articles\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7c1d8f5e7f1dc3e261766a96ac50c6a907fa5c236e87ab73379c57c9114e92cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7c1d8f5e7f1dc3e261766a96ac50c6a907fa5c236e87ab73379c57c9114e92cd?s=96&d=mm&r=g","caption":"HTML Editor"},"description":"In 2013, while wrestling with a mountain of client articles and an uncooperative CMS, I decided enough was enough. So, I created an online HTML editor purely out of necessity (and mild frustration). What began as a tool for my own sanity quickly evolved into a gift for the world\u2014or at least for anyone trying to avoid breaking their website's code. Since then, I've shared my tech notes on my blog, which serves as both a handy reference and a digital diary of the adventures and misadventures of a coder.","sameAs":["https:\/\/www.linkedin.com\/in\/ferencdenes\/","https:\/\/www.youtube.com\/@htmlg"]}]}},"_links":{"self":[{"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/posts\/474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/comments?post=474"}],"version-history":[{"count":4,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/posts\/474\/revisions"}],"predecessor-version":[{"id":1909,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/posts\/474\/revisions\/1909"}],"wp:attachment":[{"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/media?parent=474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/categories?post=474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html-online.com\/articles\/wp-json\/wp\/v2\/tags?post=474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}