How to stop list items from wrapping when zooming in using CSS

I recently created a CSS menu that is functioning well, but I'm encountering an issue when zooming in. The buttons inside the menu are wrapping onto a second line instead of staying on the same line. Any advice on how to keep the buttons in the menu on the same line without wrapping would be greatly appreciated.

Below is the code snippet I have been working with:

#cssmenu ul {
  margin: 0;
  padding: 7px 6px 0;
  background: #e3d678;
  line-height: 100%;
  display: inline-block;
  min-width: 100%;
  white-space: nowrap;
}

#cssmenu li {
  margin: 0 5px;
  padding: 0 0 8px;
  display: inline-block;
  position: relative;
  list-style: none;
}
<div id='cssmenu' dir="ltr">
  <ul>
    <li runat="server" class='active'> <a href='' "><span></a></li>    
    <li  runat="server "  >   <a href=''"><span></a></li>    
    <li  runat="server" >   <a href=''"><span></a></li>    
  </ul>
</div>

Answer №1

By inserting this particular line, the additional lines will remain unbroken and hidden from view. Don't hesitate to alter the width as needed.

#navbar ul {
  white-space: nowrap;
  overflow:hidden;
  width:300px;

  margin: 0;
  padding: 7px 6px 0;
  background: #aabbcc;
  line-height: 120%;
  display: inline-block;
  min-width: 80%;
}

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

How to seamlessly adjust the height from 0 to auto

My goal is to smoothly transition from height: 0; to height: auto; and reveal the content inside a <div></div>. One effective method I've come across involves using the max-height property. Here's an example of how it can be implement ...

Nesting CSS classes allows for more specific targeting of

I am a bit rusty on CSS, it's been about 5-7 years since I last worked with it. Could someone help me come up with a solution to my problem? Here's the ideal design I have in mind: table.ctable { class:collapsible collapsed; } I know this syn ...

Styling Labels with CSS Wildcard

I have been using the free NinjaForms plugin on my WordPress site. The default styling for labels is bold, but I prefer them to be lighter. Currently, I achieve this through CSS by targeting individual field IDs. However, this method becomes tedious when a ...

Can a JavaScript function be used with images to operate across multiple elements?

How can I make a function work on multiple elements? let image = document.getElementById("opacityLink"); image.onmouseover = function() { image.style = "opacity:0.9"; }; image.onmouseout = function() { image.style = "opacity:1"; }; <div class=" ...

Tips on swapping out an image multiple times as you hover over various text options

As a Designer creating a portfolio website, I have a good understanding of HTML and CSS. Here is my homepage: https://i.sstatic.net/WWMPA.png I am looking to create a feature where different images are displayed in a red circle preview when hovering over ...

Get rid of or substitute any unnecessary information at the beginning of the `class` name

I am receiving style information from the backend, but it includes an unwanted prefix. I need to remove this prefix and keep only the necessary styling. Can you suggest the correct approach? This is the current style code I am obtaining: <style> 04 ...

Arrange elements both at the beginning and the end of a line using FlexLayout in Angular

Using the Angular flexlayout library in angular 7/8, I am trying to align 4 buttons on the left side (flex-start) and two checkboxes on the right side (flex-end) at the same level. I would prefer to achieve this layout using the flexlayout Angular library. ...

Include a CSS counter style class that adds leading zeros

Looking for a way to increment a particular <p> style class (p.wp as an example) from 1 - n across multiple HTML pages. The challenge is that the number needs to have 4 digits, ranging from 0001 to 0117. #start_wp {counter-reset: WP 0;} p.wp{} p. ...

The process of toggling a div to slide up and down explained

I'm attempting to create a slide toggle effect on a hidden DIV when a user hovers over specific link buttons. JavaScript: $(function () { // DOM ready shorthand var $content = $(".sliderText"); var $contentdiv = $(".sliderCo ...

Shades of Progress

I am looking to customize the color of my QProgressBar based on specific value ranges: 0-60: Green 60-80: Orange 80-100: Red However, I have been unable to find a solution that allows me to change the color of the progress bar based on specific value ra ...

Steps for styling the header of an Antd Collapse Panel

I'm attempting to modify the text color in the header of an ant panel. Below is the entire ant collapse component code: <Collapse accordion defaultActiveKey={defaultOpenPanel}> <StyledCollapsePanel key="tasksAssignedToMe" header={ ...

Can a specific element be chosen based on its background color?

Is it possible to change the background color of a child element within a div that has a specific background color using CSS? See my explanation below. For example: .container[background-color=some color] .content { background-color: some other color ...

presentation not transitioning smoothly as the next slide appears

Initially, my aim is to center the slideshow on the page but I am uncertain about how to achieve it. This is how my current webpage appears: https://i.sstatic.net/E6bzQ.png Furthermore, as shown in the image, the sliding effect of the blue slide is movi ...

CSS unable to alter image on DIV hover due to technical issue

I have a DIV that changes its color when hovered over I am looking to change the image inside the div when hovering over the entire div, not necessarily just on the image itself. Here is the HTML: <div class="about"> <img class="about-project1" ...

Prevent double tap selection

At times, I enable the user to click on the <li> or <span class="icon"> elements, but if they happen to click twice, it causes a bit of chaos and spreads the blue selection all over :/ To address this issue, I have come up with two solutions: ...

The unresolvable IE7 Z-Index dilemma caused by a bug within nested elements!

Take a look. I'm struggling to get the .menu ul to display properly, it's frustrating! It shows up in ie6, ie8, safari, and ff, but not ie7! I've tried everything. Any suggestions? (I'm almost at xhtml strict validation too). ...

The Enigma of the Empty Gap When Employing "display:table/table-cell"

Struggling to understand why there is a blank space between the image and the menu. Here is the HTML and CSS related to it: <header class="header_nav"> <img src="img/logo.png" class="logo"/> <nav class="nav_bar"> <u ...

Styling components using classes in Material-UI

I recently started using material-ui and noticed that it applies inline styles to each component. After running a test with multiple instances of the same component, I realized that there was no CSS-based styling - only repeated inline styles were generate ...

Stop the excessive griping about the fact that @brand-success is undefined in variables.less

Encountering an issue while compiling less code where a NameError is triggered, stating that the variable @brand-success is undefined in app/static/css/less/style.less on line 131, column 15. Interestingly, this variable is actually imported from app/bower ...

A guide to accessing the sibling of each selector with jQuery

Imagine you have the following HTML structure: <div class="parent"> <div class="child"></div> <div class="sibling">content...</div> </div> <div class="parent"> <div class="child"></div> <div ...