admin管理员组

文章数量:1196346

I am trying to make a vertical rule disappear when my site loads on mobile. The issue that I am running into is that I cannot conditionally make it disappear. I want the vertical rule to disappear the webpage I am working on is on mobile.

From looking at the display property bootstrap docs I thought I would just need to do the following.

<div className='vr mx-3 d-sm-none'> </div>

However when inspect element and change my view to be a mobile phone I noticed that the vertical rule is still present. Is there a workaround for this?

I am trying to make a vertical rule disappear when my site loads on mobile. The issue that I am running into is that I cannot conditionally make it disappear. I want the vertical rule to disappear the webpage I am working on is on mobile.

From looking at the display property bootstrap docs I thought I would just need to do the following.

<div className='vr mx-3 d-sm-none'> </div>

However when inspect element and change my view to be a mobile phone I noticed that the vertical rule is still present. Is there a workaround for this?

Share Improve this question asked Jan 23 at 1:45 SolidSnacksSolidSnacks 393 bronze badges 1
  • 1 Bootstrap is a mobile-first framework. Use d-none to hide the vertical rule and include d-med-block to display the vertical rule on larger displays. – Rich DeBourke Commented Jan 23 at 7:51
Add a comment  | 

1 Answer 1

Reset to default -1

Rich DeBourke's comment worked perfectly for me:

Bootstrap is a mobile-first framework. Use d-none to hide the vertical rule and include d-med-block to display the vertical rule on larger displays.

本文标签: reactjsControlling Visibility of a Vertical RuleStack Overflow