Кнопка <a class="btn btn--red" href="#">Find Out More</a> не реагирует на наведение и нажатие. Подскажите, в чём может быть проблема?
body {
font-family: 'Montserrat Alternates', sans-serif;
font-size: 14px;
color: #6c7279;
background-color: #fff;
margin: 0 auto;
}
*,
*:before,
*:after {
box-sizing: border-box;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
}
p {
margin: 0 0 10px;
}
/*Container
*------*/
.container {
width: 100%;
max-width: 1170px;
margin: 0 auto;
}
/*Header
*------*/
.header {
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 1000;
width: 100%;
}
.header__inner {
display: flex;
justify-content: space-between;
padding: 35px 0;
border-bottom: 1px solid #515369;
align-items: center;
}
/*Nav
------*/
.nav {
display: flex;
font-size: 15px;
font-weight: 700;
text-transform: uppercase;
}
.nav__link {
margin-left: 50px;
color: #fff;
text-decoration: none;
opacity: 0.75;
transition: opacity 0.2 linear;
}
.nav:first-child {
margin-left: 0;
}
.nav__link:hover {
opacity: 1;
}
/*Intro
------*/
.intro {
display: flex;
padding-top: 90px;
height: 750px;
background: #31344e url("img/intro-bg.jpg") center no-repeat;
justify-content: center;
flex-direction: column;
text-align: center;
}
.intro__title {
font-size: 65px;
font-family: 'Montserrat Alternates', sans-serif;
color: #fff;
font-weight: 700;
margin: 0 0 30px;
text-transform: capitalize;
}
.intro__inner {
max-width: 970px;
width: 100%;
margin: 0 auto;
line-height: 1.1;
}
.intro__subtitle {
color: #fff;
font-size: 25px;
font-weight: 400;
width: 100%;
line-height: 1;
margin-bottom: 80px;
}
/*Button
------*/
.btn {
display: inline-block;
vertical-align: top;
padding: 14px 40px;
font-size: 13px;
color: #fff;
font-weight: 600;
text-transform: uppercase;
text-decoration: none;
font-family: inherit;
cursor: pointer;
border-radius: 2px;
border: 0;
}
.btn--red {
background-color: #e84545;
}
.btn--red:hover {
background-color: #d33838;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Active Box</title>
<link href="https://fonts.googleapis.com/css?family=Cardo:400i|Montserrat|Montserrat+Alternates:400,600&display=swap&subset=cyrillic-ext" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<!-- HEADER -->
<body>
<header class="header">
<div class="container">
<div class="header__inner">
<div class="header__logo">
<img src="img/activebox-logo.png" alt="">
</div>
<nav class="nav">
<a class="nav__link" href="#">Features</a>
<a class="nav__link" href="#">Works</a>
<a class="nav__link" href="#">About</a>
<a class="nav__link" href="#">Testimonials</a>
<a class="nav__link" href="#">Download</a>
</nav>
</div>
</div>
</header>
<!-- INTRO -->
<div class="intro">
<div class="container">
<div class="intro__inner">
<h1 class="intro__title">Welcome to my Page</h1>
<h2 class="intro__subtitle">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam nam in sequi, unde quia cumque tempore iste nulla nemo doloribus et officia magni, quibusdam laudantium hic placeat aliquam, totam. Voluptates.</h2>
<a class="btn btn--red" href="#">Find Out More</a>
</div>
</div>
</div>
</body>
</html>
Ответы (2 шт):
Автор решения: UModeL
→ Ссылка
Не знаю, зачем Вы шапку до пяток натянули, но .header {height: 100%;} при position: absolute; z-index: 1000; - это не совсем правильно, т.к. перекрывает всю страницу. Закатал шапку:
body {
font-family: 'Montserrat Alternates', sans-serif;
font-size: 14px;
color: #6c7279;
background-color: #fff;
margin: 0 auto;
}
*, *:before, *:after { box-sizing: border-box; }
h1, h2, h3, h4, h5, h6 { margin: 0; }
p { margin: 0 0 10px; }
/*Container
*------*/
.container {
width: 100%;
max-width: 1170px;
margin: 0 auto;
}
/*Header
*------*/
.header {
/* Вот тут были носки с капюшоном */
/* height: 100%; */
position: absolute;
top: 0;
left: 0;
z-index: 1000;
width: 100%;
}
.header__inner {
display: flex;
justify-content: space-between;
padding: 35px 0;
border-bottom: 1px solid #515369;
align-items: center;
}
/*Nav
------*/
.nav {
display: flex;
font-size: 15px;
font-weight: 700;
text-transform: uppercase;
}
.nav__link {
margin-left: 50px;
color: #fff;
text-decoration: none;
opacity: 0.75;
transition: opacity 0.2 linear;
}
.nav:first-child { margin-left: 0; }
.nav__link:hover { opacity: 1; }
/*Intro
------*/
.intro {
display: flex;
padding-top: 90px;
height: 750px;
background: #31344e url("img/intro-bg.jpg") center no-repeat;
justify-content: center;
flex-direction: column;
text-align: center;
}
.intro__title {
font-size: 65px;
font-family: 'Montserrat Alternates', sans-serif;
color: #fff;
font-weight: 700;
margin: 0 0 30px;
text-transform: capitalize;
}
.intro__inner {
max-width: 970px;
width: 100%;
margin: 0 auto;
line-height: 1.1;
}
.intro__subtitle {
color: #fff;
font-size: 25px;
font-weight: 400;
width: 100%;
line-height: 1;
margin-bottom: 80px;
}
/*Button
------*/
.btn {
display: inline-block;
vertical-align: top;
padding: 14px 40px;
font-size: 13px;
color: #fff;
font-weight: 600;
text-transform: uppercase;
text-decoration: none;
font-family: inherit;
cursor: pointer;
border-radius: 2px;
border: 0;
}
.btn--red { background-color: #e84545; }
.btn--red:hover { background-color: #d33838; }
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Active Box</title>
<link href="https://fonts.googleapis.com/css?family=Cardo:400i|Montserrat|Montserrat+Alternates:400,600&display=swap&subset=cyrillic-ext" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<!-- HEADER -->
<body>
<header class="header">
<div class="container">
<div class="header__inner">
<div class="header__logo">
<img src="img/activebox-logo.png" alt="">
</div>
<nav class="nav">
<a class="nav__link" href="#">Features</a>
<a class="nav__link" href="#">Works</a>
<a class="nav__link" href="#">About</a>
<a class="nav__link" href="#">Testimonials</a>
<a class="nav__link" href="#">Download</a>
</nav>
</div>
</div>
</header>
<!-- INTRO -->
<div class="intro">
<div class="container">
<div class="intro__inner">
<h1 class="intro__title">Welcome to my Page</h1>
<h2 class="intro__subtitle">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam nam in sequi, unde quia cumque tempore iste nulla nemo doloribus et officia magni, quibusdam laudantium hic placeat aliquam, totam. Voluptates.</h2>
<a class="btn btn--red" href="#">Find Out More</a>
</div>
</div>
</div>
</body>
</html>