Issue
Let me have a class I want to change its style on a certain break-point. Did I have to redefine certain properties which not change on that break-point? Example:
.nf-logo {
width: 10.4375rem;
object-fit: contain;
padding-top: 28px;
}
.login-body > h1 {
font-size: 4rem;
max-width: 800px;
margin: 0 auto;
line-height: 1.1;
text-align: center;
font-weight: 600;
}
/*Responsive Design CSS Media Query*/
@media (max-width: 768px) {
.nf-logo {
width: 108px;
object-fit: contain;
padding-top: 28px;
}
.login-body > h1 {
font-size: 3.125rem;
max-width: 640px;
margin: 0 auto;
line-height: 1.1;
text-align: center;
font-weight: 400;
}
.login-body > h2 {
font-size: 1.625rem;
margin: 1rem auto;
max-width: 640px;
font-weight: 400;
text-align: center;
}
}
/*Is it mandatory to redefine properties of classes which not changing*/
Solution
Did I have to redefine certain properties which not change on that break-point?
No.
If they are defined in a ruleset which:
- has a matching selector
- is not inside a media query that doesn't apply
Then the rule is applied.
There's no need to duplicate it in a different ruleset that applies the same rules.
Answered By - Quentin
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.