Close Menu
geekfence.comgeekfence.com
    What's Hot

    World ID expands its ‘proof of human’ vision for the AI era – Computerworld

    April 19, 2026

    Francis Bacon and the Scientific Method

    April 19, 2026

    War in the Middle East, Damaged Data Centers, and Cloud Disruptions

    April 19, 2026
    Facebook X (Twitter) Instagram
    • About Us
    • Contact Us
    Facebook Instagram
    geekfence.comgeekfence.com
    • Home
    • UK Tech News
    • AI
    • Big Data
    • Cyber Security
      • Cloud Computing
      • iOS Development
    • IoT
    • Mobile
    • Software
      • Software Development
      • Software Engineering
    • Technology
      • Green Technology
      • Nanotechnology
    • Telecom
    geekfence.comgeekfence.com
    Home»Software Development»HTML popover Attribute
    Software Development

    HTML popover Attribute

    AdminBy AdminJanuary 3, 2026No Comments3 Mins Read3 Views
    Facebook Twitter Pinterest LinkedIn Telegram Tumblr Email
    HTML popover Attribute
    Share
    Facebook Twitter LinkedIn Pinterest Email

    HTML popover Attribute

    Modals have been an important part of websites for two decades. Stacking contents and using fetch to accomplish tasks are a great way to improve UX on both desktop and mobile. Unfortunately most developers don’t know that the HTML and JavaScript specs have implemented a native modal system via the popover attribute — let’s check it out!

    The HTML

    Creating a native HTML modal consists of using the popovertarget attribute as the trigger and the popover attribute, paired with an id, to identify the content element:

    
    
    

    This is the contents of the popover

    Upon clicking the button, the popover will open. The popover, however, will not have a traditional background layer color so we’ll need to implement that on our own with some CSS magic.

    The CSS

    Styling the contents of the popover content is pretty standard but we can use the browser stylesheet selector’s pseudo-selector to style the “background” of the modal:

    /* contents of the popover */
    [popover] {
      background: lightblue;
      padding: 20px;
    }
    
    /* the dialog's "modal" background */
    [popover]:-internal-popover-in-top-layer::backdrop {
      background: rgba(0, 0, 0, .5);  
    }
    

    :-internal-popover-in-top-layer::backdrop represents the “background” of the modal. Traditionally that UI has been an element with opacity such to show the stacking relationship.

    Request Metrics real user monitoring
    Request Metrics real user monitoring
    Request Metrics real user monitoring
    Request Metrics real user monitoring
    • I’m an Impostor

      I’m an Impostor

      This is the hardest thing I’ve ever had to write, much less admit to myself.  I’ve written resignation letters from jobs I’ve loved, I’ve ended relationships, I’ve failed at a host of tasks, and let myself down in my life.  All of those feelings were very…

    • Regular Expressions for the Rest of Us

      Regular Expressions for the Rest of Us

      Sooner or later you’ll run across a regular expression. With their cryptic syntax, confusing documentation and massive learning curve, most developers settle for copying and pasting them from StackOverflow and hoping they work. But what if you could decode regular expressions and harness their power? In…

    • Create Spinning, Fading Icons with CSS3 and MooTools

      Create Spinning, Fading Icons with CSS3 and MooTools

      A goal of my latest blog redesign was to practice what I preached a bit more;  add a bit more subtle flair.  One of the ways I accomplished that was by using CSS3 animations to change the display of my profile icons (RSS, GitHub, etc.)  I…

    • Animated AJAX Record Deletion Using jQuery

      Animated AJAX Record Deletion Using jQuery

      I’m a huge fan of WordPress’ method of individual article deletion. You click the delete link, the menu item animates red, and the item disappears. Here’s how to achieve that functionality with jQuery JavaScript. The PHP – Content & Header The following snippet goes at the…



    Source link
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

    Related Posts

    Fragments: April 14

    April 18, 2026

    What Is Vibe Coding and Why It Fails in Production

    April 15, 2026

    AWS Agent Registry: Taming Wild Agents

    April 14, 2026

    Principles of Mechanical Sympathy

    April 12, 2026

    How to Build an EHR System (Electronic Health Records)

    April 9, 2026

    Anthropic’s Project Glasswing addresses how AI exploits vulnerabilities

    April 8, 2026
    Top Posts

    Understanding U-Net Architecture in Deep Learning

    November 25, 202530 Views

    Hard-braking events as indicators of road segment crash risk

    January 14, 202625 Views

    Redefining AI efficiency with extreme compression

    March 25, 202624 Views
    Don't Miss

    World ID expands its ‘proof of human’ vision for the AI era – Computerworld

    April 19, 2026

    How ‘proof of human’ works Billed as the infrastructure for the age of AI, World…

    Francis Bacon and the Scientific Method

    April 19, 2026

    War in the Middle East, Damaged Data Centers, and Cloud Disruptions

    April 19, 2026

    How Much Coding Is Required To Work in AI and LLM-related Jobs?

    April 19, 2026
    Stay In Touch
    • Facebook
    • Instagram
    About Us

    At GeekFence, we are a team of tech-enthusiasts, industry watchers and content creators who believe that technology isn’t just about gadgets—it’s about how innovation transforms our lives, work and society. We’ve come together to build a place where readers, thinkers and industry insiders can converge to explore what’s next in tech.

    Our Picks

    World ID expands its ‘proof of human’ vision for the AI era – Computerworld

    April 19, 2026

    Francis Bacon and the Scientific Method

    April 19, 2026

    Subscribe to Updates

    Please enable JavaScript in your browser to complete this form.
    Loading
    • About Us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • Terms and Conditions
    © 2026 Geekfence.All Rigt Reserved.

    Type above and press Enter to search. Press Esc to cancel.