Почему у меня отображается не так как в видео уроке?
0
42 урок курса по html/css я сверстал 4 блока как показывали, но открыв hml файл в браузере я увидел что эти 4 блока расположены не в 1 столбец как в уроке а 2. У меня есть догадка что это может быть из-за маленького экрана,если да то подскажите как решить,если нет тогда в чём ошибка?
* {
padding: 0;
margin: 0;
}
body {
font-size: 1.2em;
background-color: #fff;
color: #555;
}
p {
padding: 0 0 20px 0;
line-height: 1.7em;
}
input[type="text"], input[type="password"], input[type="search"] {
color: #5d5d5d;
width: 60%;
padding: 8px;
}
input , textarea {
outline: none;
border: none;
border: solid 1px #f2f2f2;
}
h1,h2 {
font: normal 170% 'sentury gothic', arial;
margin: 0 0 15px 0;
padding: 15px 0 5px 0;
color: #000;
}
h2 {
font-size: 140%;
}
a {
outline: none;
text-decoration: none;
color: #aeb002;
}
ul {
margin: 2px 0 22px 17px;
}
ul li {
margin: 0 0 6px 0;
padding: 0 0 4px 5px;
line-height: 1.5em;
}
.header{
background-color: darkslateblue;
height: 177px;
font-size: 0.8em;
margin-left: 0px;
margin-right: 0px;
min-width: 900px;
}
.main, .logo, .menubar,.site_content, .footer{
margin-right: auto;
margin-left: auto;
}
.logo{
width: 880px;
padding-bottom: 40px;
}
.logo h1, .logo h2,{
font: normal 300% 'century gothic', arial, sans-serif;
margin: 0 0 0 9px;
}
.logo_text h1, .logo_text h1 a, .logo_text h1 a:hover {
padding: 22px 0 0 0;
color: #fff;
letter-spasing: 0.1em;
text-decoration: none;
}
.logo_text h2 {
font-size:0.9em;
padding: 4px 0 0 0;
color: #999;
}
.menubar{
width: 900px;
height: 46px;
}
ul.menu{
float: right;
}
ul.menu li{
float: left;
padding: 0 0 0 9px;
list-style: none;
margin: 1px 2px 0 0;
}
ul.menu li a {
font: normal 100% 'trebchet ms', sans-serif;
display: block;
height: 20px;
padding: 6px 35px 5px 28px;
color: #fff;
text-decoration: none;
}
ul.menu li.selected a {
color: #5ABA03;
}
ul.menu li a:hover {
color: #1F8A05;
}
.site_content {
width: 880px;
overflow: hidden;
margin: 20px auto 0 auto;
background-color: white;
}
.sidebar_container {
float: right;
widows: 224px;
}
.sidebar {
float: right;
width: 222px;
padding: 5%;
margin: 0 0 16px 0;
border: solid 1px #f2f2f2;
border-radius: 5px;
background-color: #f9f9f9;
}
.btn {
padding: 8px;
background-color: white;
cursor: pointer;
}
.sidebar h2 {
color: #136cb2;
}
.lables_passreg_text {
font-size: 0.7em;
margin-top: 3%;
margin-left: 2%;
}
.sidebar ul {
margin: 0;
}
.sidebar ul li {
list-style-type: none;
margin: 0 0 0 0;
}
.sidebar .rating_sidebar {
float: right;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="КиноМонстр - это портал о кино">
<meta name="keywords" content="Фильмы, онлайн фильмы, hd"/>
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<title>Document</title>
</head>
<body>
<div class="main">
<div class="header">
<div class="logo">
<div class="logo_text">
<h1><a href="/">КиноМонстр</a></h1>
<h2>Кино - наша страсть!</h2>
</div>
</div>
<div class="menubar">
<ul class="menu">
<li class="selected"><a href="#">Главная</a></li>
<li><a href="#">Фильмы</a></li>
<li><a href="#">Сериалы</a></li>
<li><a href="#">Рейтинги</a></li>
<li><a href="#">Контакты</a></li>
</ul>
</div>
</div>
<div class="site_content">
<div class="sidebar_container">
<div class="sidebar">
<h2>Поиск</h2>
<from method="post" action="#" id="search_from">
<input type="search" name="search_field" placeholder="ваш запрос"/>
<input type="submit" class="btn" value="найти"/>
</from>
</div>
<div class="sidebar">
<h2>Вход</h2>
<form method="post" action="#" id="login" >
<input type="text" name="login_field" placeholder="логин"/>
<input type="password" name="password_field" placeholder="пароль"/>
<input type="submit" class="btn" value="Вход">
<div class="lables_passreg_text">
<span><a href="#">забыли пароль?</a></span> <span><a href="#">регестрация</a></span>
</div>
</form>
</div>
<div class="sidebar">
<h2>Новости</h2>
<span>31.02.2018</span>
<p>Мы запустили расширенный поиск</p>
<a href="#">читать</a>
</div>
<div class="sidebar">
<h2>Рейтинг фильмов</h2>
<ul>
<li><a href="#">Интерстеллар</a><span class="rating_sidebar">8.1</span></li>
<li><a href="#">Матрица</a><span class="rating_sidebar">8.0</span></li>
<li><a href="#">Безумный макс</a><span class="rating_sidebar">7.1</span></li>
<li><a href="#">Облачный атлас</a><span class="rating_sidebar">6.9</span></li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
Спасибо.
2 ответов
0
Основная ваша ошибка здесь:
.sidebar_container {
float: right;
widows: 224px;
}
Вы пишите widows: 224px;, а нужно писать width: 224px; Это совершенно два разных CSS-свойства.
Плюс мелкие опечатки:
font: normal 170% "sentury gothic", arial;
Вместо sentury, должно быть слово century
a {
outline: none;
text-decoration: none;
color: #aeb002;
}
Должно быть так:
a, a:hover {
outline: none;
text-decoration: underline;
color: #aeb002;
}
Также вы пишите letter-spasing: 0.1em; через букву "s", а нужно писать через букву "с":
letter-spacing: 0.1em;
Тут тоже похожая опечатка:
font: normal 100% "trebchet ms", sans-serif;
Слово trebchet писать нужно так: trebuchet.
0
Я попробовал исходник из 43 пункта курса html/css и всё работает но я не понял ошибки. Cпасибо .