Как сделать ограничение переноса текста с нижнего блока, относительно ширины верхнего?
Как сделать ограничение переноса текста с нижнего блока, относительно ширины верхнего?
body {
margin: 0;
font-family: Abel, sans-serif;
font-size: 20px;
color: 181a1f;
background-color: #17191e
}
*,
*:before,
*:after
{
box-sizing: border-box;
}
h1,h2,h3,h4,h5,h6 {
margin: 0;
}
/* Container */
.container {
width: 100%;
max-width: 1170px;
margin: 0 auto;
}
/* Header */
.header_logo {
margin-top: 43px;
}
/* Intro */
.intro {
width: 100%;
height: 100vh;
}
.intro_inner {
}
.intro_title {
line-height: 1 ;
margin-top: 200px;
font-size: 176px;
color: #ffdb00;
text-transform: uppercase;
font-weight: normal;
}
.intro_text {
text-align: left;
margin-top: 50px;
color: #fff;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css" class="css">
<link href="https://fonts.googleapis.com/css2?family=Abel&display=swap" rel="stylesheet">
<title>Montreal</title>
</head>
<body>
<div class="header">
<div class="container">
<div class="header_inner">
<div class="header_logo">
<img src="images/Logo.png" alt="logo">
</div>
</div>
</div>
</div>
<div class="intro">
<div class="container">
<div class="intro_inner">
<h1 class="intro_title">wake the design</h1>
<div class="intro_text">Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Donec sollicitudin molestie malesuada. Nulla porttitor accumsan tincidunt. </div>
</div>
</div>
</div>
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')
</script>
</body>
</html>
Ответы (1 шт):
Автор решения: highpassion
→ Ссылка
Можно ограничить ширину блока, ширину текста в h1 и настроить несколько медиа-запросов
body {
margin: 0;
font-family: Abel, sans-serif;
font-size: 20px;
color: 181a1f;
background-color: #17191e
}
*,
*:before,
*:after
{
box-sizing: border-box;
}
h1,h2,h3,h4,h5,h6 {
margin: 0;
}
/* Container */
.container {
width: 100%;
max-width: 1170px;
margin: 0 auto;
}
/* Header */
.header_logo {
margin-top: 43px;
}
/* Intro */
.intro {
width: 100%;
height: 100vh;
}
.intro_inner {
width: 100%;
}
.intro_title {
line-height: 1 ;
margin-top: 200px;
font-size: 176px;
color: #ffdb00;
text-transform: uppercase;
font-weight: normal;
}
.intro_text {
width: 100%;
max-width: 700px;
text-align: left;
margin-top: 50px;
color: #fff;
}
@media only screen and (max-width:1200px) {
.intro_inner {
padding: 0 10px;
}
}
@media only screen and (max-width: 718px) {
.intro_inner {
display: flex;
flex-direction: column;
align-items: center;
}
.intro_title {
max-width: 500px;
}
}
@media only screen and (max-width: 520px) {
.intro_title {
font-size: 32.7vw;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css" class="css">
<link href="https://fonts.googleapis.com/css2?family=Abel&display=swap" rel="stylesheet">
<title>Montreal</title>
</head>
<body>
<div class="header">
<div class="container">
<div class="header_inner">
<div class="header_logo">
<img src="images/Logo.png" alt="logo">
</div>
</div>
</div>
</div>
<div class="intro">
<div class="container">
<div class="intro_inner">
<h1 class="intro_title">wake the design</h1>
<div class="intro_text">Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Donec sollicitudin molestie malesuada. Nulla porttitor accumsan tincidunt. </div>
</div>
</div>
</div>
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')
</script>
</body>
</html>
