twitter bootstrap - CSS class hidden-xx don't works on the boundary width value -


i'm creating form using responsive design using bootstrap. goal make such input slider type on mobile devices, , text type on medium devices , bigger.

for reason i'm using different classes in 2 divs show , hide content depending on device screen width (e.g. hidden-xs, hidden-sm, hidden-md, hidden-lg).

<div class="form-group hidden-sm hidden-md hidden-lg">     <!-- input type slider mobile devices  --> </div>  <div class="form-group hidden-xs">     <!-- input type text wider screen devices  --> </div> 

i have @media rule in css file:

@media (min-width: 768px) {     .sm-view {         display: none;     } }  @media (max-width: 767px) {     .lg-view {         display: none;     } } 

it works expected, except on boundary width value of 767px, on width both divs visible:

enter image description here

as increase width value 768px slider hides, , when set width value 766px input field hides.

what i'm doing wrong?

upd here working example: https://jsfiddle.net/rnurxbw9/1/

here window width different, can see on screenshot:

enter image description here

you're not letting know bootstrap version you're using. @ documentation v4 documentation or v3 documentation

if you're using bootstrap shouldn't need set css manually. try adding visible-sm class 1 you're trying show on larger devices.

<div class="form-group hidden-sm hidden-md hidden-lg"> <!-- input type slider mobile devices  --> </div>  <div class="form-group hidden-xs visible-sm"> <!-- input type text wider screen devices  --> </div> 

Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -