T
T
tigranhamster2020-05-01 20:40:47
Layout
tigranhamster, 2020-05-01 20:40:47

How to redefine a block in css cascade so that it is 100% if there is a centering class in main?

Main contains the .centerer class. There is a block that is inside main, but the background of which should be full width. How to redefine the block in the cascade so that the block width becomes 100% of the screen width.
centerer-

.container {
  width: 940px;
  margin: 0 auto;
  padding: 0 10px;
}
<img src="https://habrastorage.org/webt/5e/ac/5e/5eac5ee1d63b0829723197.png" alt="image"/>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shsv382, 2020-05-01
@shsv382

Set the position: absolute to the block, while DO NOT set the main position, so the block will be absolutely positioned relative to the body

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question