The pseudo class remains unaltered

I've been experimenting with creating pop up links that appear next to a button when the button is clicked. So far, I've tried using various CSS selectors like :active and :hover without success.

Additionally, I attempted to use selectors such as descendent and sibling.

.stretch { 
display: none;
border: groove;
border-width: thin 0vh thin 0vh;
align-items: center;
justify-content: center;
position: relative;
}

.Links:active .stretch {
display: inline-flex;
}
<div class ="Links">
  <button> Links
    <p></p>
  </button> <!--Move arrow & slide function on links-->
  <div class = "stretch">
    <button> 
      <a id = "HLec">Harvard lec: <br> link</a>
    </button>
    <button>
      <a id = "Hex">TLDW: <br> link</a>
    </button>
    <button>
      <a id = "Vox">Vox (Don't skim the recipe): <br> link </a>
    </button>
  </div>
</div>

Answer №1

To achieve your desired outcome, consider utilizing the CSS :target Selector. This allows you to hide and display elements on a webpage by targeting specific IDs.

.stretch { 
display: none;
border: groove;
border-width: thin 0vh thin 0vh;
align-items: center;
justify-content: center;
position: relative;
}

.stretch:target {
display: inline-flex;
}
<div class ="Links">
  <a href="#elem-target"> Links
    <p></p>
  </a> <!--Move arrow & slide function on links-->
  <div class = "stretch" id="elem-target">
    <button> 
      <a id = "HLec">Harvard lec: <br> link</a>
    </button>
    <button>
      <a id = "Hex">TLDW: <br> link</a>
    </button>
    <button>
      <a id = "Vox">Vox (Don't skim the recipe): <br> link </a>
    </button>
  </div>
</div>

If you want to learn more about this topic, check out this informative link.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing CSS for a specific row within the grid-template-areas placement

Hey there, I'm diving into the world of coding and taking on a new project as a beginner. My goal is to recreate Google's Advanced Search page from scratch. Right now, I'm focusing on creating the header section using the power of display: g ...

Having trouble clicking on SubMenu with selenium web driver

Currently, I am looking into automating a UI application. In this application, there is a menu that displays sub-menus upon hovering the mouse over it. However, I am facing an issue where I am unable to click on the items within the sub-menu. Here is the ...

Mastering the placement of script tags in your Next.js application with Next Script

I'm in the process of integrating a third-party script into my Next.js website. This particular script adds an iframe right below its corresponding script tag. Therefore, it is crucial for me to have precise control over the placement of the script ta ...

What is the best way to design a table where the cells can flow or wrap instead of being confined to a strict grid?

Struggling with designing a layout for my website as I lack experience in web design. Unfortunately, the only software I have access to is FrontPage which is not meeting my requirements. I aim to create a webpage with multiple "cells," each featuring an i ...

Troubleshooting Date Problems in Angular

When using the HTML5 date picker, I have encountered an issue where after choosing a date, the ng-model displays an older date instead of the current one selected. <input type="date" ng-model="dateModel" /> For example, when selecting the current d ...

Enhance User Experience with the Tooltip Feature and Customized

Here is the jQuery code I am using to style my tooltips: $(function() { // select all input fields within #tooltips and attach tooltips to them $("#tooltips :input").tooltip({ // place tooltip on the right edge position: "cen ...

Unsuccessful CORS on whateverorigin.org with YQL

Despite trying all three methods, I keep getting an error regarding cross domain access denied. Previously, I had successfully used YQL in different parts of my applications, but now it seems to have stopped working as well. JSFIDDLE <script> $(fun ...

Having trouble installing node-sass through npm

Currently, I am attempting to install the SASS compiler node-sass in order to compile SCSS code into CSS code. Despite following an online tutorial and replicating the same steps, I keep encountering errors. npm init --yes : this will generate a json file ...

Flashing text compatibility across all browsers

I'm looking for a way to create text that blinks on all major web browsers. Initially, I attempted using the <blink> HTML tag, but unfortunately, it only works in Mozilla Firefox. Next, I experimented with CSS: <style> .blink {text-deco ...

What is the best way to implement individual fade-ins for each image in my project?

Regular Whenever I hover over one image, all images fade together. I'm not sure how to prevent this effect from occurring simultaneously. Any assistance would be greatly appreciated. Link to my stylesheet Link to my index page I have attempted to f ...

Displaying Hierarchical Data with AngularJS and ng-repeat

Recently, I've been working on finding an elegant solution to represent hierarchical data in my application. Specifically, I have implemented a slide effect for bootstrap badges that showcase sub-categories using AngularJS. With some guidance from th ...

Tips for including HTML in a JSON request in ReactJS

Upon sending the request as shown below, the response was successfully received. { "contractId": "siva8978", "html": "<p>PREFERENCE SHAREHOLDER AGREEMENTTHIS AGREEMENT is made on the&nbsp;$$Contract Start Date$$ BETWEEN&nbsp;CRADLE WEALTH ...

Ways to update the color of the mat-dialog-title using the material theme

Currently, I am utilizing the Angular Material Dialog and have been attempting to dynamically change the title color of the dialog based on the material theme. <h1 mat-dialog-title color="primary">{{ title }}</h1> Even though setting ...

Button for Selecting Colors

I love the color picker button on Google Keep, where a variety of colors pop up for selection. I'd like to add something similar to my website. What steps should I take to implement this feature? ...

Saving Data in an Angular Material Table: A How-to Guide

I have a basic angular material table and I am looking for a way to save the data displayed in each row when a button is clicked. Is it possible to save each row of data as an object and push it to an array? If so, how can I achieve this? <div class=& ...

The Label method in the Html helper does not display the id

The creation of the checkbox and its label was done using an HTML helper: @Html.CheckBoxFor(m=>m[i].checkExport) @Html.LabelFor(m=>m[i].checkExport) To customize the label, I added the following CSS in a separate file: input[type="checkbox"] + l ...

Make IE10 HTML page use IE Quirks mode

Assist me, I'm battling with Internet Explorer. We have a series of pages that function well in IE8 (on our intranet). The company has made the decision to upgrade directly to IE10. What is the HTML code needed to force a page to use IE5 Quirks Mode ...

Issues with Image Placement in Internet Explorer

My cat image on my website appears significantly lower than all the other images when viewed on Internet Explorer (v11). While it looks perfect in Chrome, I cannot figure out why this discrepancy exists. For the development of this website, I utilized pred ...

"Enhance Your Website Navigation with HTML5 and CSS - Creating a Wide

I've spent a full day trying to solve this issue, but unfortunately, I haven't been able to achieve any results. My goal is to create a menu with collapsible links that expand horizontally when hovering over the parent <li>. Essentially, it ...

Customized icons for Contact Form 7 on your Wordpress website

Currently, I am in the process of customizing a contact form by incorporating placeholder icons and text using the 'Contact Form 7' plugin within Wordpress. This particular contact form is situated on a website that I am constructing with the &ap ...