Problem with responsive navigation bar after breakpoint

Multi tool use
I have two problems with the following code:
After the 420 breakpoint, my secondlevel submenu doesn't appear (for example page 1.1 ("Seite 1.1") or page 4.2 ("Seite 4.2") etc.
There is no "hover" on a touchdevice. By clicking on page 4 ("Seite 4"), I will be redirected by the
<a href>
to (for example)seite4.html
. And that's my main problem. By clicking on page 4 ("Seite 4") you should see the submenus 4.1 and 4.2. And by clicking twice on page 4 ("Seite 4") I should be redirected toseite4.html
.
First Click: --> Open Submenu
Second Click: --> seite4.html
Does anyone know how to add a "DoubleClick" Function?
If possible, not using JavaScript.
body {
width: 100vw;
height: auto;
overflow-x: hidden;
}
#nav
{
width: 1500px;
height: 50px;
margin: auto;
background-color: #EDEDED;
}
#nav > a
{
display: none;
}
#nav li
{
position: relative;
width: 187.5px;
}
#nav ul {
text-decoration: none;
}
#nav li a {
color: black;
display: block;
}
#nav li a:active {
background-color: #c00 !important;
}
#nav span:after{
width: 0;
height: 0;
border: 0.313em solid transparent; /* 5 */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.313em; /* 5 */
}
/* first level */
#nav > ul {
height: 50px;
background-color: #EDEDED;;
}
#nav > ul > li {
width: 187.5px;
height: 50px;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 50px;
font-size: 0.9vw; /* 24 */
line-height: 2.5vw; /* 60 (24) */
text-align: center;
text-decoration: none;
}
#nav > ul > li:not( :last-child ) > a {
border-right: 0px solid black;
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
top: 100%;
background-color: #EDEDED;
list-style: none;
}
#nav li:hover ul {
display: block;
left: 0;
right: 0;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 2.5vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
/******************************************* 1500 *******************************************/
@media only screen and (max-width: 1500px) {
#nav {
width: 90vw;
height: 3.2vw;
}
#nav li {
position: relative;
width: 11.25vw;
}
#nav span:after{
width: 0;
height: 0;
border: 0.3vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.3vw; /* 5 / -0.313em */
}
/* first level */
#nav > ul {
height: 3.2vw;
background-color: #EDEDED;
}
#nav > ul > li {
width: 11.25vw;
height: 3.2vw;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 3.2vw;
font-size: 1vw; /* 24 */
line-height: 3.1vw; /* 60 (24) */
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
background-color: #EDEDED;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 3.2vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
}
/******************************************* 420 *******************************************/
@media screen and (max-width: 420px) {
body {
width: 100vw;
}
#nav {
width: 100vw;
height: 14vw;
}
#nav li {
width: 100vw;
}
#nav span:after{
border: 1.5vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -3vw; /* 5 / -0.313em */
}
#nav > a {
width: 14vw; /* 50 BUTTON*/
height: 14vw; /* 50 BUTTON */
text-align: left;
text-indent: -9999px;
background-color: lightcoral;
position: relative;
}
#nav > a:before,
#nav > a:after {
position: absolute;
border: 0.7vw solid black; /** BUTTON COLOUR **/
top: 35%;
left: 25%;
right: 25%;
content: '';
}
#nav > a:after {
top: 60%;
}
#nav:not( :target ) > a:first-of-type,
#nav:target > a:last-of-type {
display: block;
}
/* first level */
#nav > ul {
height: auto;
display: none;
position: absolute;
left: 0;
right: 0;
}
#nav:target > ul {
display: block;
}
#nav > ul > li {
width: 100%;
height: 14vw;
float: none;
}
#nav > ul > li > a {
height: auto;
text-align: left;
font-size: 5vw;
padding-top: 6vw; /* 20 (24) */
padding-bottom: 5vw;
padding-left: 2vw;
box-sizing: border-box;
}
#nav > ul > li:not( :last-child ) > a {
border-right: none;
border-bottom: 0.1vw solid lightcoral;
}
/* second level */
#nav li ul {
position: static;
height: auto;
padding: 5vw; /* 20 */
padding-top: 0;
}
#nav li ul a {
width: 100vw;
height: 14vw;
font-size: 5vw;
}
}
<body>
<nav id="nav" role="navigation">
<a href="#nav" title="Show navigation">Show navigation</a>
<a href="#" title="Hide navigation">Hide navigation</a>
<ul>
<li class="active"><a href="index.html">Startseite</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 1</span></a>
<ul>
<li><a href="/">Seite 1.1</a></li>
<li><a href="/">Seite 1.2</a></li>
</ul>
</li>
<li><a href="index.html">Seite 2</a></li>
<li><a href="index.html">Seite 3</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 4</span></a>
<ul>
<li><a href="/">Seite 4.1</a></li>
<li><a href="/">Seite 4.2</a></li>
<li><a href="/">Seite 4.3</a></li>
</ul>
</li>
<li><a href="index.html">Seit 5</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 6</span></a>
<ul>
<li><a href="/">Seite 6.1</a></li>
<li><a href="/">Seite 6.2</a></li>
</ul>
</li>
<li><a href="/">Seite 7</a></li>
</ul>
</nav>
</body>
menu navigation media-queries responsive
add a comment |
I have two problems with the following code:
After the 420 breakpoint, my secondlevel submenu doesn't appear (for example page 1.1 ("Seite 1.1") or page 4.2 ("Seite 4.2") etc.
There is no "hover" on a touchdevice. By clicking on page 4 ("Seite 4"), I will be redirected by the
<a href>
to (for example)seite4.html
. And that's my main problem. By clicking on page 4 ("Seite 4") you should see the submenus 4.1 and 4.2. And by clicking twice on page 4 ("Seite 4") I should be redirected toseite4.html
.
First Click: --> Open Submenu
Second Click: --> seite4.html
Does anyone know how to add a "DoubleClick" Function?
If possible, not using JavaScript.
body {
width: 100vw;
height: auto;
overflow-x: hidden;
}
#nav
{
width: 1500px;
height: 50px;
margin: auto;
background-color: #EDEDED;
}
#nav > a
{
display: none;
}
#nav li
{
position: relative;
width: 187.5px;
}
#nav ul {
text-decoration: none;
}
#nav li a {
color: black;
display: block;
}
#nav li a:active {
background-color: #c00 !important;
}
#nav span:after{
width: 0;
height: 0;
border: 0.313em solid transparent; /* 5 */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.313em; /* 5 */
}
/* first level */
#nav > ul {
height: 50px;
background-color: #EDEDED;;
}
#nav > ul > li {
width: 187.5px;
height: 50px;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 50px;
font-size: 0.9vw; /* 24 */
line-height: 2.5vw; /* 60 (24) */
text-align: center;
text-decoration: none;
}
#nav > ul > li:not( :last-child ) > a {
border-right: 0px solid black;
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
top: 100%;
background-color: #EDEDED;
list-style: none;
}
#nav li:hover ul {
display: block;
left: 0;
right: 0;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 2.5vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
/******************************************* 1500 *******************************************/
@media only screen and (max-width: 1500px) {
#nav {
width: 90vw;
height: 3.2vw;
}
#nav li {
position: relative;
width: 11.25vw;
}
#nav span:after{
width: 0;
height: 0;
border: 0.3vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.3vw; /* 5 / -0.313em */
}
/* first level */
#nav > ul {
height: 3.2vw;
background-color: #EDEDED;
}
#nav > ul > li {
width: 11.25vw;
height: 3.2vw;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 3.2vw;
font-size: 1vw; /* 24 */
line-height: 3.1vw; /* 60 (24) */
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
background-color: #EDEDED;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 3.2vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
}
/******************************************* 420 *******************************************/
@media screen and (max-width: 420px) {
body {
width: 100vw;
}
#nav {
width: 100vw;
height: 14vw;
}
#nav li {
width: 100vw;
}
#nav span:after{
border: 1.5vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -3vw; /* 5 / -0.313em */
}
#nav > a {
width: 14vw; /* 50 BUTTON*/
height: 14vw; /* 50 BUTTON */
text-align: left;
text-indent: -9999px;
background-color: lightcoral;
position: relative;
}
#nav > a:before,
#nav > a:after {
position: absolute;
border: 0.7vw solid black; /** BUTTON COLOUR **/
top: 35%;
left: 25%;
right: 25%;
content: '';
}
#nav > a:after {
top: 60%;
}
#nav:not( :target ) > a:first-of-type,
#nav:target > a:last-of-type {
display: block;
}
/* first level */
#nav > ul {
height: auto;
display: none;
position: absolute;
left: 0;
right: 0;
}
#nav:target > ul {
display: block;
}
#nav > ul > li {
width: 100%;
height: 14vw;
float: none;
}
#nav > ul > li > a {
height: auto;
text-align: left;
font-size: 5vw;
padding-top: 6vw; /* 20 (24) */
padding-bottom: 5vw;
padding-left: 2vw;
box-sizing: border-box;
}
#nav > ul > li:not( :last-child ) > a {
border-right: none;
border-bottom: 0.1vw solid lightcoral;
}
/* second level */
#nav li ul {
position: static;
height: auto;
padding: 5vw; /* 20 */
padding-top: 0;
}
#nav li ul a {
width: 100vw;
height: 14vw;
font-size: 5vw;
}
}
<body>
<nav id="nav" role="navigation">
<a href="#nav" title="Show navigation">Show navigation</a>
<a href="#" title="Hide navigation">Hide navigation</a>
<ul>
<li class="active"><a href="index.html">Startseite</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 1</span></a>
<ul>
<li><a href="/">Seite 1.1</a></li>
<li><a href="/">Seite 1.2</a></li>
</ul>
</li>
<li><a href="index.html">Seite 2</a></li>
<li><a href="index.html">Seite 3</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 4</span></a>
<ul>
<li><a href="/">Seite 4.1</a></li>
<li><a href="/">Seite 4.2</a></li>
<li><a href="/">Seite 4.3</a></li>
</ul>
</li>
<li><a href="index.html">Seit 5</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 6</span></a>
<ul>
<li><a href="/">Seite 6.1</a></li>
<li><a href="/">Seite 6.2</a></li>
</ul>
</li>
<li><a href="/">Seite 7</a></li>
</ul>
</nav>
</body>
menu navigation media-queries responsive
Thx but there´s no visible change. still not working
– Alex S.
Dec 30 '18 at 21:49
Hey, I still have the same problem. I´ve added the menu only on my personal domain ( yulist.de ) The mobile version is not working. Burgermenu is ok, but the submenu is not showing up
– Alex S.
Jan 7 at 15:27
add a comment |
I have two problems with the following code:
After the 420 breakpoint, my secondlevel submenu doesn't appear (for example page 1.1 ("Seite 1.1") or page 4.2 ("Seite 4.2") etc.
There is no "hover" on a touchdevice. By clicking on page 4 ("Seite 4"), I will be redirected by the
<a href>
to (for example)seite4.html
. And that's my main problem. By clicking on page 4 ("Seite 4") you should see the submenus 4.1 and 4.2. And by clicking twice on page 4 ("Seite 4") I should be redirected toseite4.html
.
First Click: --> Open Submenu
Second Click: --> seite4.html
Does anyone know how to add a "DoubleClick" Function?
If possible, not using JavaScript.
body {
width: 100vw;
height: auto;
overflow-x: hidden;
}
#nav
{
width: 1500px;
height: 50px;
margin: auto;
background-color: #EDEDED;
}
#nav > a
{
display: none;
}
#nav li
{
position: relative;
width: 187.5px;
}
#nav ul {
text-decoration: none;
}
#nav li a {
color: black;
display: block;
}
#nav li a:active {
background-color: #c00 !important;
}
#nav span:after{
width: 0;
height: 0;
border: 0.313em solid transparent; /* 5 */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.313em; /* 5 */
}
/* first level */
#nav > ul {
height: 50px;
background-color: #EDEDED;;
}
#nav > ul > li {
width: 187.5px;
height: 50px;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 50px;
font-size: 0.9vw; /* 24 */
line-height: 2.5vw; /* 60 (24) */
text-align: center;
text-decoration: none;
}
#nav > ul > li:not( :last-child ) > a {
border-right: 0px solid black;
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
top: 100%;
background-color: #EDEDED;
list-style: none;
}
#nav li:hover ul {
display: block;
left: 0;
right: 0;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 2.5vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
/******************************************* 1500 *******************************************/
@media only screen and (max-width: 1500px) {
#nav {
width: 90vw;
height: 3.2vw;
}
#nav li {
position: relative;
width: 11.25vw;
}
#nav span:after{
width: 0;
height: 0;
border: 0.3vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.3vw; /* 5 / -0.313em */
}
/* first level */
#nav > ul {
height: 3.2vw;
background-color: #EDEDED;
}
#nav > ul > li {
width: 11.25vw;
height: 3.2vw;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 3.2vw;
font-size: 1vw; /* 24 */
line-height: 3.1vw; /* 60 (24) */
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
background-color: #EDEDED;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 3.2vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
}
/******************************************* 420 *******************************************/
@media screen and (max-width: 420px) {
body {
width: 100vw;
}
#nav {
width: 100vw;
height: 14vw;
}
#nav li {
width: 100vw;
}
#nav span:after{
border: 1.5vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -3vw; /* 5 / -0.313em */
}
#nav > a {
width: 14vw; /* 50 BUTTON*/
height: 14vw; /* 50 BUTTON */
text-align: left;
text-indent: -9999px;
background-color: lightcoral;
position: relative;
}
#nav > a:before,
#nav > a:after {
position: absolute;
border: 0.7vw solid black; /** BUTTON COLOUR **/
top: 35%;
left: 25%;
right: 25%;
content: '';
}
#nav > a:after {
top: 60%;
}
#nav:not( :target ) > a:first-of-type,
#nav:target > a:last-of-type {
display: block;
}
/* first level */
#nav > ul {
height: auto;
display: none;
position: absolute;
left: 0;
right: 0;
}
#nav:target > ul {
display: block;
}
#nav > ul > li {
width: 100%;
height: 14vw;
float: none;
}
#nav > ul > li > a {
height: auto;
text-align: left;
font-size: 5vw;
padding-top: 6vw; /* 20 (24) */
padding-bottom: 5vw;
padding-left: 2vw;
box-sizing: border-box;
}
#nav > ul > li:not( :last-child ) > a {
border-right: none;
border-bottom: 0.1vw solid lightcoral;
}
/* second level */
#nav li ul {
position: static;
height: auto;
padding: 5vw; /* 20 */
padding-top: 0;
}
#nav li ul a {
width: 100vw;
height: 14vw;
font-size: 5vw;
}
}
<body>
<nav id="nav" role="navigation">
<a href="#nav" title="Show navigation">Show navigation</a>
<a href="#" title="Hide navigation">Hide navigation</a>
<ul>
<li class="active"><a href="index.html">Startseite</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 1</span></a>
<ul>
<li><a href="/">Seite 1.1</a></li>
<li><a href="/">Seite 1.2</a></li>
</ul>
</li>
<li><a href="index.html">Seite 2</a></li>
<li><a href="index.html">Seite 3</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 4</span></a>
<ul>
<li><a href="/">Seite 4.1</a></li>
<li><a href="/">Seite 4.2</a></li>
<li><a href="/">Seite 4.3</a></li>
</ul>
</li>
<li><a href="index.html">Seit 5</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 6</span></a>
<ul>
<li><a href="/">Seite 6.1</a></li>
<li><a href="/">Seite 6.2</a></li>
</ul>
</li>
<li><a href="/">Seite 7</a></li>
</ul>
</nav>
</body>
menu navigation media-queries responsive
I have two problems with the following code:
After the 420 breakpoint, my secondlevel submenu doesn't appear (for example page 1.1 ("Seite 1.1") or page 4.2 ("Seite 4.2") etc.
There is no "hover" on a touchdevice. By clicking on page 4 ("Seite 4"), I will be redirected by the
<a href>
to (for example)seite4.html
. And that's my main problem. By clicking on page 4 ("Seite 4") you should see the submenus 4.1 and 4.2. And by clicking twice on page 4 ("Seite 4") I should be redirected toseite4.html
.
First Click: --> Open Submenu
Second Click: --> seite4.html
Does anyone know how to add a "DoubleClick" Function?
If possible, not using JavaScript.
body {
width: 100vw;
height: auto;
overflow-x: hidden;
}
#nav
{
width: 1500px;
height: 50px;
margin: auto;
background-color: #EDEDED;
}
#nav > a
{
display: none;
}
#nav li
{
position: relative;
width: 187.5px;
}
#nav ul {
text-decoration: none;
}
#nav li a {
color: black;
display: block;
}
#nav li a:active {
background-color: #c00 !important;
}
#nav span:after{
width: 0;
height: 0;
border: 0.313em solid transparent; /* 5 */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.313em; /* 5 */
}
/* first level */
#nav > ul {
height: 50px;
background-color: #EDEDED;;
}
#nav > ul > li {
width: 187.5px;
height: 50px;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 50px;
font-size: 0.9vw; /* 24 */
line-height: 2.5vw; /* 60 (24) */
text-align: center;
text-decoration: none;
}
#nav > ul > li:not( :last-child ) > a {
border-right: 0px solid black;
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
top: 100%;
background-color: #EDEDED;
list-style: none;
}
#nav li:hover ul {
display: block;
left: 0;
right: 0;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 2.5vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
/******************************************* 1500 *******************************************/
@media only screen and (max-width: 1500px) {
#nav {
width: 90vw;
height: 3.2vw;
}
#nav li {
position: relative;
width: 11.25vw;
}
#nav span:after{
width: 0;
height: 0;
border: 0.3vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.3vw; /* 5 / -0.313em */
}
/* first level */
#nav > ul {
height: 3.2vw;
background-color: #EDEDED;
}
#nav > ul > li {
width: 11.25vw;
height: 3.2vw;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 3.2vw;
font-size: 1vw; /* 24 */
line-height: 3.1vw; /* 60 (24) */
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
background-color: #EDEDED;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 3.2vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
}
/******************************************* 420 *******************************************/
@media screen and (max-width: 420px) {
body {
width: 100vw;
}
#nav {
width: 100vw;
height: 14vw;
}
#nav li {
width: 100vw;
}
#nav span:after{
border: 1.5vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -3vw; /* 5 / -0.313em */
}
#nav > a {
width: 14vw; /* 50 BUTTON*/
height: 14vw; /* 50 BUTTON */
text-align: left;
text-indent: -9999px;
background-color: lightcoral;
position: relative;
}
#nav > a:before,
#nav > a:after {
position: absolute;
border: 0.7vw solid black; /** BUTTON COLOUR **/
top: 35%;
left: 25%;
right: 25%;
content: '';
}
#nav > a:after {
top: 60%;
}
#nav:not( :target ) > a:first-of-type,
#nav:target > a:last-of-type {
display: block;
}
/* first level */
#nav > ul {
height: auto;
display: none;
position: absolute;
left: 0;
right: 0;
}
#nav:target > ul {
display: block;
}
#nav > ul > li {
width: 100%;
height: 14vw;
float: none;
}
#nav > ul > li > a {
height: auto;
text-align: left;
font-size: 5vw;
padding-top: 6vw; /* 20 (24) */
padding-bottom: 5vw;
padding-left: 2vw;
box-sizing: border-box;
}
#nav > ul > li:not( :last-child ) > a {
border-right: none;
border-bottom: 0.1vw solid lightcoral;
}
/* second level */
#nav li ul {
position: static;
height: auto;
padding: 5vw; /* 20 */
padding-top: 0;
}
#nav li ul a {
width: 100vw;
height: 14vw;
font-size: 5vw;
}
}
<body>
<nav id="nav" role="navigation">
<a href="#nav" title="Show navigation">Show navigation</a>
<a href="#" title="Hide navigation">Hide navigation</a>
<ul>
<li class="active"><a href="index.html">Startseite</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 1</span></a>
<ul>
<li><a href="/">Seite 1.1</a></li>
<li><a href="/">Seite 1.2</a></li>
</ul>
</li>
<li><a href="index.html">Seite 2</a></li>
<li><a href="index.html">Seite 3</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 4</span></a>
<ul>
<li><a href="/">Seite 4.1</a></li>
<li><a href="/">Seite 4.2</a></li>
<li><a href="/">Seite 4.3</a></li>
</ul>
</li>
<li><a href="index.html">Seit 5</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 6</span></a>
<ul>
<li><a href="/">Seite 6.1</a></li>
<li><a href="/">Seite 6.2</a></li>
</ul>
</li>
<li><a href="/">Seite 7</a></li>
</ul>
</nav>
</body>
body {
width: 100vw;
height: auto;
overflow-x: hidden;
}
#nav
{
width: 1500px;
height: 50px;
margin: auto;
background-color: #EDEDED;
}
#nav > a
{
display: none;
}
#nav li
{
position: relative;
width: 187.5px;
}
#nav ul {
text-decoration: none;
}
#nav li a {
color: black;
display: block;
}
#nav li a:active {
background-color: #c00 !important;
}
#nav span:after{
width: 0;
height: 0;
border: 0.313em solid transparent; /* 5 */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.313em; /* 5 */
}
/* first level */
#nav > ul {
height: 50px;
background-color: #EDEDED;;
}
#nav > ul > li {
width: 187.5px;
height: 50px;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 50px;
font-size: 0.9vw; /* 24 */
line-height: 2.5vw; /* 60 (24) */
text-align: center;
text-decoration: none;
}
#nav > ul > li:not( :last-child ) > a {
border-right: 0px solid black;
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
top: 100%;
background-color: #EDEDED;
list-style: none;
}
#nav li:hover ul {
display: block;
left: 0;
right: 0;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 2.5vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
/******************************************* 1500 *******************************************/
@media only screen and (max-width: 1500px) {
#nav {
width: 90vw;
height: 3.2vw;
}
#nav li {
position: relative;
width: 11.25vw;
}
#nav span:after{
width: 0;
height: 0;
border: 0.3vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.3vw; /* 5 / -0.313em */
}
/* first level */
#nav > ul {
height: 3.2vw;
background-color: #EDEDED;
}
#nav > ul > li {
width: 11.25vw;
height: 3.2vw;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 3.2vw;
font-size: 1vw; /* 24 */
line-height: 3.1vw; /* 60 (24) */
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
background-color: #EDEDED;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 3.2vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
}
/******************************************* 420 *******************************************/
@media screen and (max-width: 420px) {
body {
width: 100vw;
}
#nav {
width: 100vw;
height: 14vw;
}
#nav li {
width: 100vw;
}
#nav span:after{
border: 1.5vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -3vw; /* 5 / -0.313em */
}
#nav > a {
width: 14vw; /* 50 BUTTON*/
height: 14vw; /* 50 BUTTON */
text-align: left;
text-indent: -9999px;
background-color: lightcoral;
position: relative;
}
#nav > a:before,
#nav > a:after {
position: absolute;
border: 0.7vw solid black; /** BUTTON COLOUR **/
top: 35%;
left: 25%;
right: 25%;
content: '';
}
#nav > a:after {
top: 60%;
}
#nav:not( :target ) > a:first-of-type,
#nav:target > a:last-of-type {
display: block;
}
/* first level */
#nav > ul {
height: auto;
display: none;
position: absolute;
left: 0;
right: 0;
}
#nav:target > ul {
display: block;
}
#nav > ul > li {
width: 100%;
height: 14vw;
float: none;
}
#nav > ul > li > a {
height: auto;
text-align: left;
font-size: 5vw;
padding-top: 6vw; /* 20 (24) */
padding-bottom: 5vw;
padding-left: 2vw;
box-sizing: border-box;
}
#nav > ul > li:not( :last-child ) > a {
border-right: none;
border-bottom: 0.1vw solid lightcoral;
}
/* second level */
#nav li ul {
position: static;
height: auto;
padding: 5vw; /* 20 */
padding-top: 0;
}
#nav li ul a {
width: 100vw;
height: 14vw;
font-size: 5vw;
}
}
<body>
<nav id="nav" role="navigation">
<a href="#nav" title="Show navigation">Show navigation</a>
<a href="#" title="Hide navigation">Hide navigation</a>
<ul>
<li class="active"><a href="index.html">Startseite</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 1</span></a>
<ul>
<li><a href="/">Seite 1.1</a></li>
<li><a href="/">Seite 1.2</a></li>
</ul>
</li>
<li><a href="index.html">Seite 2</a></li>
<li><a href="index.html">Seite 3</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 4</span></a>
<ul>
<li><a href="/">Seite 4.1</a></li>
<li><a href="/">Seite 4.2</a></li>
<li><a href="/">Seite 4.3</a></li>
</ul>
</li>
<li><a href="index.html">Seit 5</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 6</span></a>
<ul>
<li><a href="/">Seite 6.1</a></li>
<li><a href="/">Seite 6.2</a></li>
</ul>
</li>
<li><a href="/">Seite 7</a></li>
</ul>
</nav>
</body>
body {
width: 100vw;
height: auto;
overflow-x: hidden;
}
#nav
{
width: 1500px;
height: 50px;
margin: auto;
background-color: #EDEDED;
}
#nav > a
{
display: none;
}
#nav li
{
position: relative;
width: 187.5px;
}
#nav ul {
text-decoration: none;
}
#nav li a {
color: black;
display: block;
}
#nav li a:active {
background-color: #c00 !important;
}
#nav span:after{
width: 0;
height: 0;
border: 0.313em solid transparent; /* 5 */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.313em; /* 5 */
}
/* first level */
#nav > ul {
height: 50px;
background-color: #EDEDED;;
}
#nav > ul > li {
width: 187.5px;
height: 50px;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 50px;
font-size: 0.9vw; /* 24 */
line-height: 2.5vw; /* 60 (24) */
text-align: center;
text-decoration: none;
}
#nav > ul > li:not( :last-child ) > a {
border-right: 0px solid black;
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
top: 100%;
background-color: #EDEDED;
list-style: none;
}
#nav li:hover ul {
display: block;
left: 0;
right: 0;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 2.5vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
/******************************************* 1500 *******************************************/
@media only screen and (max-width: 1500px) {
#nav {
width: 90vw;
height: 3.2vw;
}
#nav li {
position: relative;
width: 11.25vw;
}
#nav span:after{
width: 0;
height: 0;
border: 0.3vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.3vw; /* 5 / -0.313em */
}
/* first level */
#nav > ul {
height: 3.2vw;
background-color: #EDEDED;
}
#nav > ul > li {
width: 11.25vw;
height: 3.2vw;
float: left;
list-style: none;
}
#nav > ul > li > a {
height: 3.2vw;
font-size: 1vw; /* 24 */
line-height: 3.1vw; /* 60 (24) */
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a {
background-color: lightcoral;
}
/* second level */
#nav li ul {
display: none;
position: absolute;
background-color: #EDEDED;
}
#nav li:not( :first-child ):hover ul {
left: 0;
}
#nav li ul a {
font-size: 0.9vw;
border-top: 0.05vw solid lightcoral;
height: auto;
line-height: 3.2vw;
text-align: center;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a {
background-color: lightcoral;
}
}
/******************************************* 420 *******************************************/
@media screen and (max-width: 420px) {
body {
width: 100vw;
}
#nav {
width: 100vw;
height: 14vw;
}
#nav li {
width: 100vw;
}
#nav span:after{
border: 1.5vw solid transparent; /* 5 / 0.313em */
border-bottom: none;
border-top-color: black;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -3vw; /* 5 / -0.313em */
}
#nav > a {
width: 14vw; /* 50 BUTTON*/
height: 14vw; /* 50 BUTTON */
text-align: left;
text-indent: -9999px;
background-color: lightcoral;
position: relative;
}
#nav > a:before,
#nav > a:after {
position: absolute;
border: 0.7vw solid black; /** BUTTON COLOUR **/
top: 35%;
left: 25%;
right: 25%;
content: '';
}
#nav > a:after {
top: 60%;
}
#nav:not( :target ) > a:first-of-type,
#nav:target > a:last-of-type {
display: block;
}
/* first level */
#nav > ul {
height: auto;
display: none;
position: absolute;
left: 0;
right: 0;
}
#nav:target > ul {
display: block;
}
#nav > ul > li {
width: 100%;
height: 14vw;
float: none;
}
#nav > ul > li > a {
height: auto;
text-align: left;
font-size: 5vw;
padding-top: 6vw; /* 20 (24) */
padding-bottom: 5vw;
padding-left: 2vw;
box-sizing: border-box;
}
#nav > ul > li:not( :last-child ) > a {
border-right: none;
border-bottom: 0.1vw solid lightcoral;
}
/* second level */
#nav li ul {
position: static;
height: auto;
padding: 5vw; /* 20 */
padding-top: 0;
}
#nav li ul a {
width: 100vw;
height: 14vw;
font-size: 5vw;
}
}
<body>
<nav id="nav" role="navigation">
<a href="#nav" title="Show navigation">Show navigation</a>
<a href="#" title="Hide navigation">Hide navigation</a>
<ul>
<li class="active"><a href="index.html">Startseite</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 1</span></a>
<ul>
<li><a href="/">Seite 1.1</a></li>
<li><a href="/">Seite 1.2</a></li>
</ul>
</li>
<li><a href="index.html">Seite 2</a></li>
<li><a href="index.html">Seite 3</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 4</span></a>
<ul>
<li><a href="/">Seite 4.1</a></li>
<li><a href="/">Seite 4.2</a></li>
<li><a href="/">Seite 4.3</a></li>
</ul>
</li>
<li><a href="index.html">Seit 5</a></li>
<li>
<a href="/" aria-haspopup="true"><span>Seite 6</span></a>
<ul>
<li><a href="/">Seite 6.1</a></li>
<li><a href="/">Seite 6.2</a></li>
</ul>
</li>
<li><a href="/">Seite 7</a></li>
</ul>
</nav>
</body>
menu navigation media-queries responsive
menu navigation media-queries responsive
edited Dec 30 '18 at 20:02


zx485
14.1k123047
14.1k123047
asked Dec 30 '18 at 10:58
Alex S.Alex S.
62
62
Thx but there´s no visible change. still not working
– Alex S.
Dec 30 '18 at 21:49
Hey, I still have the same problem. I´ve added the menu only on my personal domain ( yulist.de ) The mobile version is not working. Burgermenu is ok, but the submenu is not showing up
– Alex S.
Jan 7 at 15:27
add a comment |
Thx but there´s no visible change. still not working
– Alex S.
Dec 30 '18 at 21:49
Hey, I still have the same problem. I´ve added the menu only on my personal domain ( yulist.de ) The mobile version is not working. Burgermenu is ok, but the submenu is not showing up
– Alex S.
Jan 7 at 15:27
Thx but there´s no visible change. still not working
– Alex S.
Dec 30 '18 at 21:49
Thx but there´s no visible change. still not working
– Alex S.
Dec 30 '18 at 21:49
Hey, I still have the same problem. I´ve added the menu only on my personal domain ( yulist.de ) The mobile version is not working. Burgermenu is ok, but the submenu is not showing up
– Alex S.
Jan 7 at 15:27
Hey, I still have the same problem. I´ve added the menu only on my personal domain ( yulist.de ) The mobile version is not working. Burgermenu is ok, but the submenu is not showing up
– Alex S.
Jan 7 at 15:27
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53977067%2fproblem-with-responsive-navigation-bar-after-breakpoint%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53977067%2fproblem-with-responsive-navigation-bar-after-breakpoint%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
YnRlXXJLSof1Fc Myi FPoKxvuM6W,p g1k1NBdyCOF2Naa JdDsLRxA1
Thx but there´s no visible change. still not working
– Alex S.
Dec 30 '18 at 21:49
Hey, I still have the same problem. I´ve added the menu only on my personal domain ( yulist.de ) The mobile version is not working. Burgermenu is ok, but the submenu is not showing up
– Alex S.
Jan 7 at 15:27