I have
@media (max-width: 360px),
@media (max-width: 320px),
@media (max-width: 768px),
and so on...
for the responsiveness of my website(assignment). I first put the css codes inside the max-width:360px
, and then when i'm putting now my codes in max-width:320px
, it doesn't change the sizing/margin/padding etc. of the elements. It needs !important before it works, that's why I have many !important in my code, like: "margin-left:240px !important;
". And I believe if i started coding for the max-width:768px
, the sizing won't work. Is there a way on how to fix this?? Help i'm a beginner.
This is the sample code:
@media (max-width: 320px) {
.txtyourrest
{
font-size:20px ; /*will work*/
}
}
@media (max-width: 360px) {
.txtyourrest
{
font-size:25px !important; /*will work*/
}
}
@media (max-width: 768px) {
.txtyourrest
{
font-size:30px !important; /*wont work*/
}
}