Mam problem z rozwijanym menu. Chciałem zrobić tę samą stronę, która była tworzona w poradniku na yt- css odc.3.
Nie potrafię tak ustawić rozwijanych z menu opcji aby były równo pod napisami np. "Gry filmowe".
Nie mam pojęcia co robię źle, będę wdzięczny jeśli ktoś mi pomoże.
<!DOCTYPE HTML>
<html lang="pl">
<head>
<meta charset="utf-8"/>
<title>Retrogranie</title>
<meta name="description" content="Serwis o grach komputerowych" />
<meta name= "keywords" content="gry, nintendo, retro, nes" />
<meta http-equiv="X-UA-Compatibile" content="IE=edge,chrome=1"/>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap&subset=latin-ext" rel="stylesheet">
<link href="css/fontello.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
<div class="header">
<div class="logo">
<img src="img/pad.png" style="float: left;" />
<span style="color: #c34f4f">Retro</span>granie.com
<div style="clear: both;"></div>
</div>
</div>
<div class="nav">
<ol>
<li><a href="#">Strona głowna</a></li>
<li><a href="#">Klasyki NES</a>
<ul>
<li><a href="#">Contra</a></li>
<li><a href="#">Mario Bros</a></li>
<li><a href="#">Duck Tales</a></li>
<li><a href="#">Legend of Zelda</a></li>
</ul>
</li>
<li><a href="#">Gry fimowe</a>
<ul>
<li><a href="#">Home Alone</a></li>
<li><a href="#">Dick Tracy</a></li>
<li><a href="#">The Simpsons</a></li>
<li><a href="#">Top Gun</a></li>
</ul>
</li>
<li><a href="#">Bijatyki</a>
<ul>
<li><a href="#">Mortal Kombat</a></li>
<li><a href="#">Nekketsu K.D.</a></li>
<li><a href="#">Double Dragon</a></li>
<li><a href="#">Turtles T.</a></li>
</ul>
</li>
<li><a href="#">Gry sportowe</a>
<ul>
<li><a href="#">Goal 3</a></li>
<li><a href="#">Excitebike</a></li>
<li><a href="#">Ike Ike Hockey</a></li>
<li><a href="#">Tennis</a></li>
</ul>
</li>
<li><a href="#">O autorach</a></li>
</ol>
</div>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </p>
<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
<p>But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?</p>
<p>But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?</p>
</div>
<div class="socials">
<div class="socialdivs">
<div class="fb">
<i class="icon-facebook-official"></i>
</div>
<div class="yt">
<i class="icon-youtube"></i>
</div>
<div class="tw">
<i class="icon-twitter"></i>
</div>
<div class="gplus">
<i class="icon-gplus"></i>
</div>
<div style="clear: both;"></div>
</div>
</div>
<div class="footer"> Retrogranie.com © 2019</div>
</div>
<script src="jquery-3.4.0.min.js"></script>
<script>
$(document).ready(function() {
var NavY = $('.nav').offset().top;
var stickyNav = function(){
var ScrollY = $(window).scrollTop();
if (ScrollY > NavY) {
$('.nav').addClass('sticky');
} else {
$('.nav').removeClass('sticky');
}
};
stickyNav();
$(window).scroll(function() {
stickyNav();
});
});
</script>
</body>
</html>
body
{
color: #ffffff;
background-color: #303030;
font-family: 'Lato', sans-serif;
font-szie: 20px;
margin: 0 !important;
}
.wrapper
{
width: 100%;
}
.header
{
width: 100%;
padding: 40px 0;
}
.logo
{
width: 450px;
font-size: 48px;
margin-left: auto;
margin-right: auto;
}
.nav
{
width: 100%;
padding: 10px 0;
background-color: #c34f4f;
text-align: center;
border-top: 1px solid #751b1b;
border-bottom: 1px solid #751b1b;
}
.content
{
width: 1000px;
margin-left: auto;
margin-right: auto;
text-align: justify;
padding-top: 10px;
}
.socials
{
width: 100%;
text-aligh: center;
background-color: #292929;
}
.socialdivs
{
width: 1000px;
margin-left: auto;
margin-right: auto;
}
.fb
{
float: left;
width: 250px;
height: 155px;
text-align: center;
}
.fb:hover
{
background-color: #4668b3;
}
.yt
{
float: left;
width: 250px;
height: 155px;
text-align: center;
}
.yt:hover
{
background-color: #d94348;
}
.tw
{
float: left;
width: 250px;
height: 155px;
text-align: center;
}
.tw:hover
{
background-color: #3095d3;
}
.gplus
{
float: left;
width: 250px;
height: 155px;
text-align: center;
}
.gplus:hover
{
background-color: #d95333;
}
.footer
{
text-align: center;
background-color: #222222;
padding: 30px;
}
.sticky
{
width: 100%;
position: fixed;
left: 0;
top: 0;
z-index: 100;
}
ol
{
padding: 0;
margin: 0;
list-style-type: none;
font-size: 18px;
height: 35px;
line-height: 200%; /* Jak wiele miejsca w pionie zajmuje jedna linia tektu; coś jak interlinia*/
display: inline-block;
}
ol a
{
color: #ffffff;
text-decoration: none;
display: block;
}
ol > li
{
float: left;
width: 150px;
height: 40px;
border-right: 1px dashed #751b1b;
}
ol > li:first-child
{
border-left: 1px dashed #751b1b;
}
ol > li:hover
{
background-color: #cf6969;
}
ol > li:hover > a
{
color: #451717;
}
ol > li > ul
{
list-style-type: none;
paddig: 0;
margin: 0;
height: 40px;
display: none;
width: 150px;
}
ol > li:hover > ul
{
display: block;
}
ol > li > ul > li
{
background-color: #cf6969;
position: relative;
z-index: 100;
border-top: 1px dashed #751b1b;
}
ol > li > ul > li:hover
{
background-color: #c34f4f;
}
ol > li > ul > li:hover > a
{
color: #451717;
}