I’m trying to make a 90s styled website, and I need to set the wideness of a div with .padding-side
to calc(100% - 20px)
, but it won’t work.
I tried doing the following:
[style.css]
.padding-side{
padding:0px 10px;
.wide{
width:calc(100% - 20px) !important;
}
}
It didn’t work. I tried:
.padding-side & .wide{
padding:0px 10px;
width:calc(100% - 20px);
}
But it didn’t work.
2
Answers
To add a CSS rule for a element that has two classes you can do this:
Or if you want to always have the padding on the .padding-side class and if a element has both classes to set the width you can do this.
But the browser support for this is not perfect.
Probably your parent .padding-side needs to have width: 100%; This is needed in case that .padding-side is not block level element.
If this is not working, then try adding width: 100% to other parent elements.
I you can provide whole html + css we can get you better answer.