T
T
Think With Your Head2015-10-02 14:28:13
css
Think With Your Head, 2015-10-02 14:28:13

How can I force an image (or block) to ignore the parent's side paddings and stretch to its full width?

Hello!
I know a way to set the parent to relative and 100% to the absolute block, but then the wrapping disappears and everything below absolute must be set to margin equal to the height of the absolute block.
I think this method is crooked and looking for a new one.
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Korolev, 2015-10-02
@Vyad

The child block needs to have negative padding equal to the padding.
jsfiddle.net/wv5pf4ob

D
Dmitry Novikov, 2015-10-02
@dmitriy_novikov

try negative margin combined with box-sizing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question