Overlapping CSS Menu

I've been working on creating a CSS menu and here's what I have accomplished so far:

Check out my code on Js Fiddle

However, I'm encountering an issue where the menu items overlap when the browser width is decreased. You can see the problem in action here:

Link to updated Js Fiddle Code

Any suggestions on how to ensure that the items are displayed on the next line instead of overlapping?

Answer №1

If I were to tackle this, my approach would be to forego a distinct class for the chosen menu item and instead opt for a menuItem selected with a float:left property.

Feel free to explore this jsfiddle example

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

Closing the modal by simply clicking outside of it's boundaries

Is there a way to close the modal by clicking outside of it using pure JS or AngularJS? I'm struggling to figure out how to implement this functionality. Any assistance would be greatly appreciated. View Fiddle .modalDialog { position: fixed; ...

Enhance CSS delivery for the items listed below

Reduce the delay caused by rendering JavaScript and CSS above-the-fold. There are 16 CSS resources currently blocking the rendering of your page. This delay could be affecting the loading time of your content. To improve this issue, consider deferring or ...

connecting checkbox elements to another and distinguishing between them during publication

Below are three checkbox tags each representing a different category: <input type="checkbox" name="catpref[]" value=1> Politics<br> <input type="checkbox" name="catpref[]" value=2> Sports<br> <input type="checkbox" name="catpref ...

Show Bootstrap's hamburger menu by default and position it on the left-hand side

Is it possible to make Bootstrap's collapsed, aka "Hamburger", menu appear by default on the left side of the browser? If I want to have the collapsed menu positioned on the left side, do I just need to modify the code as shown below? <!-- the co ...

Run a CGI script every time a button is clicked on a webpage, while keeping the current html page intact

As I embark on my internship working with a Home Server capable of controlling multiple domotics equipment from a web page, I am faced with an exciting challenge. The concept involves triggering specific scripts on the server via button clicks to control a ...

What's preventing vh from functioning in Chrome, yet it's fully operational in Internet Explorer?

Currently, I am utilizing vh for my project, which as far as I know represents 1 percent of the view height of the page. This measurement should function similar to percentages, especially with borders and potentially other elements. However, when I tested ...

The alignment of text is being randomized within Owl-Carousel containers using HTML

I'm facing an issue with the display of my text, and I suspect it might be related to Owl-Carousel. Here is how it's appearing: https://i.sstatic.net/C03TL.jpg Below is the HTML Code: <div class="panel panel-casestudy" data-equalizer-watch= ...

The Javascript calculation function fails to execute proper calculations

I have been facing immense frustration while working on a project lately. The project involves creating a unique Webpage that can calculate the total cost for users based on their selections of radio buttons and check boxes. Assuming that all other functi ...

Having an issue with HTML and JavaScript where the button won't open when pressed. Any help is appreciated

https://jsbin.com/haluhifuqe/edit?html,js,output I'm facing an issue with my HTML & JavaScript code - when I click the button, it doesn't open. Can anyone help me out? <!DOCTYPE html> <html> <head> <meta charset="utf-8 ...

fragment of the visual display

Are you aware that by utilizing the canvas tag in HTML5, it is possible to load a small portion of a large image with minimal load times? This can be advantageous when creating a game with just a few tiles but of considerable size, as it reduces the numb ...

Unable to implement the `omega/theme.css` file within the angular.json configuration

"styles": [ "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "node_modules/bootstrap/dist/css/bootstrap.min.css", "src/styles.css", "node_modules/primeicons/primeicons.css", ...

How can I retrieve the mouse click coordinates on an image using JavaScript?

Currently facing an issue with the code provided below for retrieving x/y coordinates in JavaScript. I am working on creating a color picker using an image. The objective is to display a color window and cancel button when a user clicks on the pick color ...

How to load a URL into a div using jQuery and then update the div with new content?

I have a codeigniter view that I want to load into a div as an iframe using the following code: <script type='text/javascript'> $(document).ready(function (){ $('#divId').load('http://www.domain.oo/page.php?test=1); }); ...

I am unable to view the entire HTML element

i have a pair of div elements first one : text-logo .text-logo { width: 250px; height: 60px; margin: auto; border: 2px solid #07a2a0; border-radius: 15px 50px 15px 50px; margin-top: 100px; ...

What is the reason for nth-of-type selectors not functioning on the third element?

I have a question regarding CSS nth-of-type. In the following code snippet, nth-of-type(2) and nth-of-type(3) are functioning properly, however, nth-of-type(4) and nth-of-type(5) are not working as expected. Could there be an issue with my code? <div i ...

Do I have to include the sizes attribute when using w-descriptors in srcset?

After reading several articles discussing the use of srcset for device-pixel-density adjustments and art direction, I have come to a few conclusions: The State of Responsive Images in 2015 by Paddi Macdonnell srcset Part 2: The W descriptor and sizes att ...

Creating a Table with Alternating Rows in HTML

Here is how my table looks. I attempted to apply striping with the following CSS: tr:nth-child(even) { background-color:#AD0D10; } <table> <tr> <th >xxx</th> <th >xxxxx</th> <th>xxxxxxx</th& ...

Firefox Conditional Comments

Do older versions of Firefox, such as version 3.0, have unique Conditional Comments available for them? ...

Duplicate text content from a mirrored textarea and save to clipboard

I came across some code snippets here that are perfect for a tool I'm currently developing. The codes help in copying the value of the previous textarea to the clipboard, but it doesn't work as expected when dealing with cloned textareas. Any sug ...

How Can You Create a Sliding List Animation (Up/Down) Using Angular and Twitter-Bootstrap?

Hey, can you give me a hand with this? :) I'm attempting to create a sleek sliding up and down list in Angular, but I'm struggling to make it work. My CSS skills are not very advanced, so I'm still learning and gave it my best shot: http:// ...