css3 - bootstrap-responsive - how to redefine / overwrite a css class -


background info

i'm trying hand @ first responsive app using bootstrap. far, good. i'm trying target google nexus 7 , default, seems classified "phone" based on following css see in bootstrap-responsive.css:

@media (max-width: 767px) {   .hidden-desktop {     display: inherit !important;   }   .visible-desktop {     display: none !important;   }   .visible-phone {     display: inherit !important;   }   .hidden-phone {     display: none !important;   } } 

in 1 of pages, have following logic:

 <div class="row-fluid visible-desktop">                                html here desktop version          display big buttons  </div>   <div class="row-fluid visible-tablet">                             html here ipads          display medium buttons  </div>   <div class="row-fluid visible-phone">                              display divs, not buttons.  </div> 

problem

currently, nexus 7 in portrait mode picking section phones, , can't understand why? other question have how overwrite or redefine bootstrap's "phone" media query in own custom css? (please see notes below understand i've tried far)

what i've tried far:

as test, went resizemybrowser.com using nexus , says current inner 980x1294 when in portrait mode. guess don't understand why nexus diplays phone section if size high? perhaps i'm misunderstanding information displayed resizemybrowser.com website.

i've been playing around custom.css , have found browser size seems correctly target nexus me:

/* google nexus 7 portrait */ @media (min-width:500px) , (max-width: 720px) , (orientation:portrait){     body{         background-color: green;     } } 

i'm testing nexus 7, ipod 5, ipad , samsung galaxy 3 , above media query, device picks green background nexus... want. thinking redefine media query in bootstrap-responsive this: (basically changing max size of browser 767 500px).

@media (max-width: 500px) {   .hidden-desktop {     display: inherit !important;   }   .visible-desktop {     display: none !important;   }   .visible-phone {     display: inherit !important;   }   .hidden-phone {     display: none !important;   } } 

the idea define smaller browser size phones...and create new media query target mini tablets. seems creating above media query in custom.css doesn't replace / overwrite 1 in bootstrap. don't want change code in bootstrap directly. can tell me i'm doing wrong?

thanks.

edit 1:

this how i'm loading 2 css files:

<link href="<?php echo base_url('assets/css/bootstrap-responsive.css')?>" rel="stylesheet">         <link href="<?php echo base_url('assets/css/custom.css')?>" rel="stylesheet">      

it looks you're doing correctly.

the problem css file being called before bootstrap file , why not taking precedence on it.

move custom stylesheet bottom of header , see if gives stylesheet priority on others.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -