Conceal the link until the div is hovered over

Is there a way to hide the [Add|Edit] link and only show it when hovering over the handle? The desired outcome is to display "001-001 Item 6" by default, as illustrated in the image.

    .dd-list { display: block; position: relative; margin: 0; padding: 0; list-style: none; }
    .dd-handle { display: block; height: 30px; margin: 5px 0; padding: 5px 10px; color: #334151; text-decoration: none; font-weight: bold; border:  1px solid rgba(255,255,255, 0.3);
       background-color: #F1F2F9;
        box-sizing: border-box; -moz-box-sizing: border-box;
    }
    .dd-handle:hover { color: #000;  }
    a {
        color: #8760fb;
        text-decoration: none;
        background-color: transparent;
    }
    a:hover {
        color: #7c59e6;
      }
  <ol class="dd-list">
    <li class="dd-item" data-id="6">
    <div class="dd-handle">Item 6 [<a href="#Add.aspx">Add</a>|<a href="Edit.aspx"> Edit</a>]</div>
    </li>
    <li class="dd-item" data-id="7">
    <div class="dd-handle">Item 7 [<a href="#Add.aspx">Add</a>|<a href="Edit.aspx"> Edit</a>]</div>
    </li>
    <li class="dd-item" data-id="8">
    <div class="dd-handle">001-000 Equipment [<a href="#Add.aspx">Add</a>|<a href="Edit.aspx"> Edit</a>] </div>
    </li>
    </ol>
     

View Result

Answer №1

Hopefully, the solution provided below will help

.dd-list { display: block; position: relative; margin: 0; padding: 0; list-style: none; }
    .dd-handle { display: block; height: 30px; margin: 5px 0; padding: 5px 10px; color: #334151; text-decoration: none; font-weight: bold; border:  1px solid rgba(255,255,255, 0.3);
       background-color: #F1F2F9;
        box-sizing: border-box; -moz-box-sizing: border-box;
    }
    .dd-handle:hover .hide{ color: #000;display:inline
    }
   
    .hide{
    color: #000;display:none
    }
     
    a {
        color: #8760fb;
        text-decoration: none;
        background-color: transparent;
    }
    a:hover {
        color: #7c59e6;
      }
<ol class="dd-list">
    <li class="dd-item" data-id="6">
    <div class="dd-handle">Item 6 <span class="hide">[<a  href="#Add.aspx">Add</a>|<a href="Edit.aspx"> Edit</a>]</span></div>
    </li>
    <li class="dd-item" data-id="7">
    <div class="dd-handle">Item 7 <span class="hide">[<a  href="#Add.aspx">Add</a>|<a  href="Edit.aspx"> Edit</a>]</span></div>
    </li>
    <li class="dd-item" data-id="8">
    <div class="dd-handle">001-000 Equipment <span class="hide">[<a  href="#Add.aspx">Add</a>|<a  href="Edit.aspx"> Edit</a>]</span> </div>
    </li>
    </ol>

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

Evaluate the user's answers to a database using a SQLite 3 C++ Quiz

Currently, I am in the process of writing a C++ program that utilizes SQLite. The main aim is to enable users to specify their preferred hotel room options. Subsequently, the program compares these user selections with the information stored in a database. ...

Collapsing tabs feature in Bootstrap 4

I am working on a project with Bootstrap 4 Tab. My goal is to initially hide all tab contents and then show them when the corresponding tab is clicked. I achieved this by removing the active class from the tab-pane div. However, I encountered an issue wher ...

Which JSF element is capable of displaying a <div> element?

For example, h:inputText will display an "input type='text'". Which JSF tag is used to render a "div" element? ...

HTML fields that are serialized as deeply nested JSON objects

Currently, I am working on a Java REST web service that handles POST data from a basic HTML form. My goal is to ensure that the client code sends the correct JSON to the web service in order for the server code to populate my objects accurately. The data ...

In Angular 15, CSS override configurations do not function as intended

Exploring the world of Angular is exciting, and I am a newcomer to it. Currently, I am tackling an innovative Angular 15 project that makes use of the Material library. My current predicament lies in the fact that none of the CSS overrides appear to be tak ...

Allow images to extend beyond the boundaries of the grid in Bootstrap 4

I'm trying to figure out how to display an image that starts inside a grid but scales to the left or right of the screen. The current issue is that the container limits the width, and I need it to allow the image to extend beyond the grid. If you hav ...

Can anyone explain the strange hexagonal substance that appeared in my POST to an InMagic Textworks system?

Upon reviewing the POST request details on an Inmagic TextWorks system in Chrome developer tools, I discovered the following while delving into the POST: Form Data view source URL encoded status: mode:sort currentPage:1 querySql:[PROCESSED]c:5f:2:61:58:-6 ...

Modify the state of each individual button

I recently came across a cool implementation using clicks and jQuery fade effects to show a div when a button is clicked and then change the state of the button. Check it out here: http://jsfiddle.net/ttj9J/5/ HTML <a class="link" href="#" data-rel="c ...

What causes the slowness of onsubmit=" " function?

Initially, I had the following setup: HTML: <form onsubmit="return validate()"> ... <input type="submit" id="submit-button"/> </form> JS: function validate() { // Extensive validation process with regex and more... $(& ...

PHP: I am unable to establish a connection with the script or submit form data to mySQL

Seeking assistance with debugging this script. (The * represents confidential information that I am aware of but cannot share) <?php $dbhost = '*********'; $dbuser = '*********'; $dbpass = '*********'; $conn = mysql_conne ...

Learn the effective way to customize the primary button text color in Bootstrap 4 using SCSS styling

Looking to customize the .btn-primary text color. I attempted to modify the background color in _variables.scss by adding the following line: $primary: #a1c1b6; However, I was unable to change the text color despite trying various options. // not working ...

Trouble arises when implementing personalized buttons on the Slick JS slider

Are you struggling to customize buttons for your Slick Slider JS? I am facing a similar issue with applying my own button styles to the slider. I am interested in using arrow icons instead of the default buttons. Here is the HTML code snippet: <secti ...

The information is failing to display properly within the mat-menu

Recently, I've been working on creating a navbar that includes a submenu. Even though the navigation bar data is loading properly, I am facing some issues with the submenu functionality. As a beginner in this area, I would appreciate any help or guida ...

Developing a modal with various hyperlinks

I'm currently working on a website that features multiple news articles, each linking to a separate page. Is it possible to use modal windows to have the articles pop up on the same page instead of opening in a new window? If so, I would greatly appre ...

``Enhance your website with stunning Bootstrap 4 image cards that beautifully showcase

I'm having trouble creating 3 simple image cards with captions in Bootstrap 4. No matter what I do, the image keeps taking up the entire card and covering the caption below it. My cards should look similar to Bootstrap's example card, using the ...

Problem with Bootstrap-slider not loading correctly

I seem to be facing an issue with selecting DOM elements that are part of bootstrap-slider. When I try to target them with events like click, nothing happens. All events work fine when the page is refreshed. What could be causing this problem? $(document ...

Displaying text beneath an image in an ASP.NET menu control

I'm struggling to display the menu name below the menu icon in my ASPX code. Can anyone help me with this? ASPX Code <asp:menu runat="server" ItemWrap="true" Orientation="Horizontal"> <Items> <asp:MenuIte ...

Error - Oops! It seems like there was a TypeError that occurred because the property 'innerHTML' cannot be set for something that

I keep encountering this issue in my code. Uncaught TypeError: Cannot set property 'innerHTML' of undefined Despite trying various suggestions from other posts with similar errors like Uncaught TypeError: Cannot set property 'innerHTML&apos ...

swap between style sheets glitching

My website features two stylesheets, one for day mode and one for night mode. There is an image on the site that triggers a function with an onclick event to switch between the two stylesheets. However, when new visitors click the button for the first ti ...

Elevate the value of a particular element's variable through the execution of a function

By using a for loop, I was able to generate a variable number of divs that change their background color individually when hovered over with the mouse. Now, I want to implement a function that will decrease the brightness of each div by 10% every time it i ...