How do I use @media to lock padding-top at lower resolutions?

1

How do I block the padding of this function

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

The goal is to block padding at lower resolutions.

    
asked by anonymous 01.12.2014 / 14:39

2 answers

1

Use 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 this link has a tutorial on how to use CSS half-queries.

    
01.12.2014 / 14:46
1

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

Try to put! important in your rule in @media

@media... {
   .classeDaDiv {
       padding-top: 0 !important;
    
01.12.2014 / 14:48