тег текста находится в неправильном блоке
Приветствую всех заглянувших. У меня есть небольшая проблема, тег текста находится не там где нужно. Элемент касается середины слайдера, а я хочу, чтобы он находился после остальных тегов.
Вроде попытался что-то сделать,но не получилось. И еще, хотелось бы сделать адаптивный header, он не растягивается на 100 процентов экрана, если уменьшить окно, то блок не будет задевать края.
body {
margin: 0;
padding: 0;
background-color: #515151;
}
/*Header with Spread logo, and links...*/
.font-face {
font-family: Tolkien;
src: url(Tolky.TTF);
}
a {
color: rgb(0, 0, 0);
text-decoration: none
}
header {
min-height: 9vh;
background-color: #1b1b1b;
font-family: Tolkien;
src: url(Tolky.TTF);
width: 100%;
max-width: 1000em;
margin: 0 auto;
}
.header_logo_links {
display: flex;
align-items: center;
justify-content: center;
justify-content: space-around;
width: 100%;
}
.margin_0_and_logo {
display: contents;
}
.spread_logotype {
font-size: 3em;
display: flex;
align-items: baseline;
}
.spread_text {
color: rgb(255, 255, 255);
}
.header_links {
font-family: Radwave;
src: url(RadwaveFont-Regular.otf);
font-size: 1.5em;
margin-top: 0.33em;
display: flex;
}
.link_text {
color: rgb(255, 255, 255);
padding: 1em;
transition: all 0.5s ease-out;
}
.link_text:hover {
color: lawngreen;
transition: all 0.2s ease-out;
}
/*Slaider for third images*/
.all {
height: 45vh;
}
slider {
position: relative;
text-align: center;
top: 10px;
}
#slider {
margin: 0 auto;
}
#slides article {
width: 20%;
float: left;
}
#slides .image {
width: 500%;
line-height: 0;
}
#overflow {
width: 100%;
overflow: hidden;
}
article img {
width: 100%;
}
#switch2:checked~#controls label:nth-child(1),
#switch3:checked~#controls label:nth-child(2),
#switch5:checked~#controls label:nth-child(4) {
background: url(https://i.imgur.com/abBxfpM.png) no-repeat;
float: left;
display: block;
height: 68px;
width: 68px;
}
#switch1:checked~#controls label:nth-child(2),
#switch2:checked~#controls label:nth-child(3),
#switch5:checked~#controls label:nth-child(1) {
background: url(https://i.imgur.com/dggILEN.png) no-repeat;
float: right;
display: block;
height: 68px;
width: 68px;
}
label,
a {
cursor: pointer;
}
.all input {
display: none;
}
#switch1:checked~#slides .image {
margin-left: 0;
}
#switch2:checked~#slides .image {
margin-left: -100%;
}
#switch3:checked~#slides .image {
margin-left: -200%;
}
#controls {
margin: -47vh 0px 0px;
width: 100%;
height: 50px;
}
#active label {
border-radius: 10px;
display: inline-block;
width: 15px;
height: 15px;
background: #bbb;
}
#active label:hover {
background: #76c8ff;
border-color: #777 !important;
}
#slides .image {
transition: all 800ms cubic-bezier(0.4, 0, 0.2, 1);
}
#controls label:hover {
opacity: 0.6;
}
#controls label {
transition: opacity 0.2s ease-out;
}
a#download {
text-align: center;
width: 150px;
margin: 0px auto;
padding: 20px;
color: white;
text-transform: uppercase;
font-family: Arial;
border: 1px solid #fff;
text-decoration: none;
border-radius: 10px;
}
<header>
<div class="header_logo_links">
<div class="spread_logotype">
<div class="margin_0_and_logo">
<a href="index.html"><img src="https://i.imgur.com/h8wzsPB.png" alt="Пример"></a>
<a href="index.html" class="spread_text">pread</a>
</div>
</div>
<div class="header_links">
<a href="#" class="link_text">Merch</a>
<a href="#" class="link_text">Music</a>
<a href="#" class="link_text">Videos</a>
<a href="#" class="link_text">Community</a>
</div>
</div>
</header>
<section>
<div class="all">
<input checked type="radio" name="respond" id="desktop">
<article id="slider">
<input checked type="radio" name="slider" id="switch1">
<input type="radio" name="slider" id="switch2">
<input type="radio" name="slider" id="switch3">
<div id="slides">
<div id="overflow">
<div class="image">
<article><img src="https://i.imgur.com/AUb3z25.png"></article>
<article><img src="https://i.imgur.com/JYym5Ua.png"></article>
<article><img src="https://i.imgur.com/sSc1w0l.png"></article>
</div>
</div>
</div>
<div id="controls">
<label for="switch1"></label>
<label for="switch2"></label>
<label for="switch3"></label>
</div>
</article>
</div>
</section>
<h1>434</h1>
Ответы (1 шт):
Автор решения: cMeTaHKuH
→ Ссылка
Нашел пока такое решение проблемы. Я задал section'у класс и указал в нем общие размеры блока со слайдером изображений:
body {
margin: 0;
padding: 0;
background-color: #515151;
}
/*Header with Spread logo, and links...*/
.font-face {
font-family: Tolkien;
src: url(Tolky.TTF);
}
a {
color: rgb(0, 0, 0);
text-decoration: none
}
header {
min-height: 9vh;
background-color: #1b1b1b;
font-family: Tolkien;
src: url(Tolky.TTF);
width: 100%;
max-width: 1000em;
margin: 0 auto;
}
.header_logo_links {
display: flex;
align-items: center;
justify-content: center;
justify-content: space-around;
width: 100%;
}
.margin_0_and_logo {
display: contents;
}
.spread_logotype {
font-size: 3em;
display: flex;
align-items: baseline;
}
.spread_text {
color: rgb(255, 255, 255);
}
.header_links {
font-family: Radwave;
src: url(RadwaveFont-Regular.otf);
font-size: 1.5em;
margin-top: 0.33em;
display: flex;
}
.link_text {
color: rgb(255, 255, 255);
padding: 1em;
transition: all 0.5s ease-out;
}
.link_text:hover {
color: lawngreen;
transition: all 0.2s ease-out;
}
/*Slaider for third images*/
.slaider__main{
height: 80vh;
}
slider {
position: relative;
text-align: center;
top: 10px;
}
#slider {
margin: 0 auto;
}
#slides article {
width: 20%;
float: left;
}
#slides .image {
width: 500%;
line-height: 0;
}
#overflow {
width: 100%;
overflow: hidden;
}
article img {
width: 100%;
}
#switch2:checked~#controls label:nth-child(1),
#switch3:checked~#controls label:nth-child(2),
#switch5:checked~#controls label:nth-child(4) {
background: url(https://i.imgur.com/abBxfpM.png) no-repeat;
float: left;
display: block;
height: 68px;
width: 68px;
}
#switch1:checked~#controls label:nth-child(2),
#switch2:checked~#controls label:nth-child(3),
#switch5:checked~#controls label:nth-child(1) {
background: url(https://i.imgur.com/dggILEN.png) no-repeat;
float: right;
display: block;
height: 68px;
width: 68px;
}
label,
a {
cursor: pointer;
}
.all input {
display: none;
}
#switch1:checked~#slides .image {
margin-left: 0;
}
#switch2:checked~#slides .image {
margin-left: -100%;
}
#switch3:checked~#slides .image {
margin-left: -200%;
}
#controls {
margin: -47vh 0px 0px;
width: 100%;
height: 50px;
}
#active label {
border-radius: 10px;
display: inline-block;
width: 15px;
height: 15px;
background: #bbb;
}
#active label:hover {
background: #76c8ff;
border-color: #777 !important;
}
#slides .image {
transition: all 800ms cubic-bezier(0.4, 0, 0.2, 1);
}
#controls label:hover {
opacity: 0.6;
}
#controls label {
transition: opacity 0.2s ease-out;
}
a#download {
text-align: center;
width: 150px;
margin: 0px auto;
padding: 20px;
color: white;
text-transform: uppercase;
font-family: Arial;
border: 1px solid #fff;
text-decoration: none;
border-radius: 10px;
}
<header>
<div class="header_logo_links">
<div class="spread_logotype">
<div class="margin_0_and_logo">
<a href="index.html"><img src="https://i.imgur.com/h8wzsPB.png" alt="Пример"></a>
<a href="index.html" class="spread_text">pread</a>
</div>
</div>
<div class="header_links">
<a href="#" class="link_text">Merch</a>
<a href="#" class="link_text">Music</a>
<a href="#" class="link_text">Videos</a>
<a href="#" class="link_text">Community</a>
</div>
</div>
</header>
<section class="slaider__main">
<div class="all">
<input checked type="radio" name="respond" id="desktop">
<article id="slider">
<input checked type="radio" name="slider" id="switch1">
<input type="radio" name="slider" id="switch2">
<input type="radio" name="slider" id="switch3">
<div id="slides">
<div id="overflow">
<div class="image">
<article><img src="https://i.imgur.com/AUb3z25.png"></article>
<article><img src="https://i.imgur.com/JYym5Ua.png"></article>
<article><img src="https://i.imgur.com/sSc1w0l.png"></article>
</div>
</div>
</div>
<div id="controls">
<label for="switch1"></label>
<label for="switch2"></label>
<label for="switch3"></label>
</div>
</article>
</div>
</section>
<h1>434</h1>

