When learning about responsive design, one pattern that is frequently seen is:
@media screen and (max-width: 480px){
.class1{
width: inherit;
float: none;
}
.class2{
width: inherit;
float: none;
}
for two the two classes which were set to float: left
in a parent container.
I am just wondering: is this code redundant? If the width is set to inherit
, there is no way for any other element to float around it, or do I miss anything?
Edit Thanks to @BoltClock here are some examples where there is a difference
If the children are in a block context, it does not float: none;
is not necessary:
In an inline context float: left
looks broken:
while float: none
provides the desired result