What is the process for making a hover box?

When visiting the website and hovering over the All Services link, a popup overlay with various categories will appear.

What is the best way to implement this while also ensuring it remains SEO friendly?

Please refer to the attached image for reference:

https://i.sstatic.net/hSk5q.png

Answer №1

In my view, the best way to structure it would be like this. Even though everything is enclosed in a <div>, it still holds semantic value as long as the child elements are correctly structured within the HTML.

div>nav>ul>li {
  font-size: 25px;
}

nav>ul>li>ul>li {
font-size: 15px;
}

div>nav {
  display: none;
}

div:hover nav {
  display: block;
}

ul {
  list-style-type: none;
}
<div><span>menu</span>
  <nav>
    <ul>
      <li><span>category 1</span>
        <ul>
          <li><a>item 1</a></li>
          <li><a>item 2</a></li>
          <li><a>item 3</a></li>
          <li><a>item 4</a></li>
          <li><a>item 5</a></li>
        </ul>
      </li>
      <li><span>category 2</span>
        <ul>
          <li><a>item 1</a></li>
          <li><a>item 2</a></li>
          <li><a>item 3</a></li>
          <li><a>item 4</a></li>
          <li><a>item 5</a></li>
        </ul>
      </li>
      <li><span>category 3</span>
        <ul>
          <li><a>item 1</a></li>
          <li><a>item 2</a></li>
          <li><a>item 3</a></li>
          <li><a>item 4</a></li>
          <li><a>item 5</a></li>
        </ul>
      </li>
    </ul>
  </nav>
</div>

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

Develop a professional Angular application for deployment

Help! I'm struggling to build my Angular application for production. After running the 'ng build --prod' command, I can't find all my components in the 'dist' folder. Do I need to change or configure something else? I see som ...

javascript onload select the text in the textarea

Is there a way to have JavaScript automatically highlight the text inside a textarea when the page is loaded? ...

Searching across multiple attributes in Jquery UI Autocomplete: A comprehensive guide

My data is stored in an array of objects with a structure similar to this: $scope.usersList = [{ "name": "John", "email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f09a9f989eb088898ade939f9d">[email protected ...

When the Next.js app is built, the API route provides the initial data, which typically occurs during development

I am encountering an issue with my Next.js page using App Router. The page retrieves data from its route API, which is obtained from MQTT. During development (running dev), when we send a request to api/getLocation, it returns updated data from MQTT. Howev ...

Axios continues to encounter the issue of downloading a faulty PDF file

Every time I attempt to download a PDF file to the client side using axios, it ends up corrupted. In my MERN stack webapp, a user can click a button to initiate the download of a PDF file. This button triggers an axios GET request to the Node.js web server ...

Adjust the positioning of an HTML element in relation to another to prevent elements from moving erratically

Currently, I am working on a website where I have implemented some javascript to achieve a 'typewriter' effect for the prominent middle-centered text displayed below. The script is designed to animate the text by typing it letter by letter in a f ...

Scrolling causes the image to blink

I have a specific task to create an effect where an image blinks three times on scrolling (like lights turning on and off consecutively with a 1-second delay), and then stays on until the user scrolls beyond 3600px. To achieve this, I have added an event ...

Challenges encountered while making CSS adjustments on the Wordpress Twentyfourteen theme

I'm currently assisting a friend with making some final adjustments to their website. The site is built on Wordpress using the Twentyfourteen theme and can be found at centromariposa.no. Most of the modifications have been completed, but I'm fac ...

Events bound to JSX elements created in an array map are not being triggered by React

My current task involves working on a compact react + typescript (1.6) application designed for editing slideshows. The functionality of the app is straightforward. A sidebar on the left displays all existing slides, and upon clicking, a canvas appears on ...

HTML/CSS code for a header with elements centered across the full width of the screen

Having an outdated WordPress theme from 2010, I wanted to give it a modern touch by adding a sticky header. I found a plugin called myStickymenu that seemed to work well. However, my current theme's header has a fixed width of 960px and I desired to m ...

What is the best way to assign a different set of sub tabs to each individual tab?

Upon hovering over MTH025-ENG111, I would like it to become visible. Any additional tips or tools you have to assist me with this are greatly appreciated. <html> <head> <title> join the club </title> </ ...

A HTML input field that allows for multiple values to be populated by autofill functionality, similar to the features found

Can anyone assist me with creating a text box similar to the one in Facebook's new message feature? In that feature, we are able to add multiple people in the 'To' field, all of whom are suggested from our friend list. I would like to implem ...

Gleaming R: Warning prompt or modal box input: invalid

In the process of developing a basic application, I am seeking to implement a pop-up notification for invalid inputs. By referencing the suggestion provided in #1656, I have come up with an example that introduces a visually appealing background color when ...

Showing the information obtained from an API request once the user submits the form without the need to reload the page

I am currently working on a form that will take search query requests from users upon submission and then display the results by making an API call. My goal is to show these results without the page having to refresh, using AJAX. The backend connection to ...

Putting a halt to increasing the level at a designated altitude

Incorporating a slot machine-style animation, I am currently animating images within a logo. The goal is to make the animation halt when it reaches the top of the image and trigger a callback if possible. Below is my current method for executing the anima ...

Having trouble fixing an ASP Classic Script issue with two unnecessary buttons. The script includes two buttons instead of just one, causing confusion and ineff

Hey there, I've encountered a little issue with the ASP Script and the HTML elements inside the body tags. It seems to be generating two buttons instead of just one, which is not what I intended. My main goal here is to remove one of the buttons so th ...

Using Vue.$set, you can create nested objects that were previously missing in your

Is there a way to generate missing nested objects (such as bar, a, b, and c) when employing Vue.$set in the following manner? export const mutations = { UPDATE(state, payload) { this._vm.$set(state.foo.bar.a.b.c, payload.key, payload.value) } } In ...

Transitioning font sizes may appear jagged on mobile devices

I have been attempting to implement a transition effect on the font-size property. While it works perfectly on desktop browsers, I am facing issues with mobile browsers such as Android Chrome, iOS Chrome, and Safari, where the font-size transition appears ...

The method $event.stopPropogation doesn't seem to be functioning properly

I am facing an issue where the functionality of a div is affected when clicking on an input box inside it. When the div is selected and colored red, clicking on the input box within the selected div causes the div to become unselected (grey in color). I ...

Tips for adjusting the maximum width and content-based width for columns within an HTML/CSS table

I'm working on a simple HTML/CSS code featuring a container with two adjustable slots, controlled by a handler in the middle to modify the space each slot occupies. The first slot contains a table with fixed columns, automatic columns, and limited col ...