here's a picture of the question https://toster.ru/q/607853
And what is the best way to make the background of the "SPECIAL TECHNIQUE" header reach the end of the site? Then I realized you can make linegradient
here's a picture of the question https://toster.ru/q/607853
And what is the best way to make the background of the "SPECIAL TECHNIQUE" header reach the end of the site? Then I realized you can make linegradient
You can use a negative margin
.with-offset { margin-right: -50px; margin-left: 50px; }
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <div class="container"> <div class="bg-info"> <h1 class="text-white">MainContent</h1> <div class="row"> <div class="col-6"> </div> <div class="col-6"> <div class="bg-danger"> <h2>Заголовок 1</h2> </div> <div class="bg-warning with-offset"> <h2>Заголовок 2</h2> </div> </div> </div> </div> </div>
background header "SPECIALS" on the right reached the end of the site
body, html { margin: 0; padding: 0; } header { overflow: hidden; } .header-content .h1-span { position: relative; } .header-content .h1-span::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; background: rgba(250, 190, 13, 0.7); right: -3000px; } .container { position:relative; max-width:70%; margin: 0 auto; } .container .wrap-container { position:relative; z-index:2; } .container:after { content:""; position:absolute; right:0; top: -90px; position:absolute; bottom:0; left:-1000px; background: url("http://placeimg.com/500/300/an") no-repeat 100% 0/100% 100%; }
<header> <div class="container"> <div class="wrap-container"> <div class="header-content"> <h1>Аренда<div class="h1-span"><span>спецтехники</span></div></h1> </div> </div> </div> </header>
for background something like this through a pseudo-element: after,
.container { position:relative; } .container:after { content:""; position:absolute; right:0; top: -90px; position:absolute; bottom:0; left:-2000px; background: url(../img/bg-header.jpg) no-repeat 100% 0/auto 100%; }
Source: https://ru.stackoverflow.com/questions/949668/
All Articles