dimanche 1 avril 2018

disable width to inherit other divs

basically i have a css code that sets the background and adjusts it to the best position that i've found (to not see borders of the image,etc). but i have to set that image as an background, so i did the main div and set the class that have the background

.bgimg{
    background-image: url(https://d2v9y0dukr6mq2.cloudfront.net/video/thumbnail/acgu0vt/crystalline-motion-background-crystalized-movement-ice-sheets-blood-red_bbmkzqinp__F0000.png);
    height: 100%;
    width:  110%;

    transform-origin: center;
    background-repeat: repeat;
    background-position: 0 , 0;

    background-size: cover;
}

and thats fine until i get to this problem. when i put things inside this div, the width of it gets stretched to 110%. so my wondering was, how do i disable this property to get inherited? or maybe other approaches, like setting the background without having to be inside a div or body.




Aucun commentaire:

Enregistrer un commentaire