C
C
Cyril2018-06-14 16:38:18
css
Cyril, 2018-06-14 16:38:18

Background through svg, how to center?

There is a site, it's max-width: 1920px, the content on it is max-width: 1200px.
This site has a block whose content is 1200px and (!) it needs to file 3 images in the form of svg (through the corresponding tag) as a background (content is placed on top of it), the width of this background is 1920px.
I did the following for the background:

<section>
   <div class="content">.......</div>
   <div class="background_imgs">
       <div class="background_imgs-img">
             ////svg
        </div>
       <div class="background_imgs-img">
             ////svg
        </div>
       <div class="background_imgs-img">
             ////svg
        </div>
   </div>

section {position:relative; width: 1920px}
.content {width:1200px}
.background_imgs {position: absolute; width: 1920px}

The question is, how can I make .background_imgs show content on a screen width of, for example, 1300, 1300 pixels wide, and at the same time its wide sides go beyond the page, equally on each side? 310px | 1300px | 310px . 1300 visible content

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question