How do I use @media to block padding-top in smaller resolutions?

Asked

Viewed 88 times

1

How do I block 'padding' from that function

   <div style=" width: 300px;  float:left; padding-top:68px" > no @media ?

The goal is to block 'padding' in smaller resolutions.

2 answers

1


Utilize class along with @media:

.minha-div {
  padding-top: 68px;
  width: 300px;
  float: left;
}
@media (max-width: 300px) {
  .minha-div {
    padding-top: 0px !important;
  }
}
<div style="" class="minha-div">

</div>

In that link has a tutorial on how to use CSS media queries.

  • it worked Vlw man

  • When the answer solves the problem, mark it as correct. xD

  • It was bad for the cloud, marked.

1

In CSS the rules are applied in order... in your case probably loads before html.

Try to put ! Mportant in your rule in @media

@media... {
   .classeDaDiv {
       padding-top: 0 !important;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.