← Комьюнити

Как применить стили css к второму заголовку?

Александр Колесникович3 ответов

Проблема с оформлением второго заголовка.

не могу применить css с-ва к второму заголовку.

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta name="description" content="Киномостр - это портал о кино">
<meta name="keywords" content="фильммы, фильмы онлайн">
<link rel="stylesheet" href="assets/css/style.css">
</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>
</div>

</body>
</html>

CSS

.header {
background-color: darkslateblue;
height: 177px;
font-size: 0.8em;
margin-left: 0;
margin-right: 0;
min-width: 900px;
}

.main, .logo, .menubar, .site_content, .footer {
margin-left: auto;
margin-right: 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 h2, .logo-text h1 a:hover {
padding: 22px 0 0 0;
color: #FFF;
letter-spacing: 0.1em;
text-decoration: none;
}
.logo-text h2 {
font-size: 0.09em;
padding: 4px 0 0 0;
color: #999;
}

3 ответов

Весь код приложите к вопросу: HTML полностью и CSS полностью, попробую помочь.

student_BFScU1U-2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta name="description" content="Киномостр - это портал о кино">
<meta name="keywords" content="фильммы, фильмы онлайн">
<link rel="stylesheet" href="assets/css/style.css">
</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>
</div>

</body>
</html>

CSS

.header {
background-color: darkslateblue;
height: 177px;
font-size: 0.8em;
margin-left: 0;
margin-right: 0;
min-width: 900px;
}

.main, .logo, .menubar, .site_content, .footer {
margin-left: auto;
margin-right: 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 h2, .logo-text h1 a:hover {
padding: 22px 0 0 0;
color: #FFF;
letter-spacing: 0.1em;
text-decoration: none;
}
.logo-text h2 {
font-size: 0.09em;
padding: 4px 0 0 0;
color: #999;
}
Александр Колесникович1

У вас в этих стилях ошибки (вот так правильно):

.logo_text h1, .logo_text h1 a, .logo_text h1 a:hover {
    padding: 22px 0 0 0;
    color: #fff;
    letter-spacing: 0.1em;
    text-decoration: none;
}

.logo_text h2 {
    font-size: 0.9em;
    padding: 4px 0 0 0;
    color: #999;	
}
student_BFScU1U-1
Как применить стили css к второму заголовку? — FructCode | FructCode