I try to remove the break between "Startseite" and the number on the dropdown below "News", whatever I try it always wraps
I tried to get
#navigation nav #main-list li ul li
to stop the wrap but none of the css wrap functions worked for me
I try to remove the break between "Startseite" and the number on the dropdown below "News", whatever I try it always wraps
I tried to get
#navigation nav #main-list li ul li
to stop the wrap but none of the css wrap functions worked for me
#navigation nav #main-list li ul {
white-space: nowrap;
}
I note that your CSS can be simplified:
*
rules, they are expensive and resetting margins and padding to zero messes-up defaults which can harm readability unless you're going to go through the effort of manually setting them for every element you're using.float: left;
is now obsolete for stacking elements horizontally. Consider using display: inline-box
instead, which also gives you more control over appearance and means you can avoid having to use clear
.Even with float
you don't need a manual <div class="clearer">
anymore, use the ::after
pseudo-element instead:
(container of floating elements)::after {
display: block;
content: " ";
clear: both;
}
Your nav
element is being wasted in this context. Consider replacing your <div id="navigation">
with just <nav>
and eliminating the inner <nav>
element.
<div id="wrapper">
isn't serving any purpose in this example. Also, consider replacing it with a simple <section>
element, which makes your markup (slightly) more semantic.Add white-space: nowrap;
to #navigation nav #main-list li a
.
See this updated fiddle:
#navigation nav #main-list li a {
display: block;
padding: 0 12px;
color: #eee;
white-space: nowrap;
text-decoration: none;
}
As long as its OK for you to be editing the code manually, you can do this very simple change.
replace:
<li><a href="/">Startseite 1</a></li>
with
<li><a href="/">Startseite 1</a></li>
stands for Non Breaking Space, which is exactly what you need.