Skip to content
Advertisement

How to hide text in navbar elements on different screen size Bootstrap 4

How do I hide elements of a navbar in bootstrap inline rather than creating a new element for each screen size. I tried using a span but that just causes the line to wrap.

JavaScript

The example below is the only solution I have found to hide and show based on screen size. But I do not like the code it looks a little messy

JavaScript

Advertisement

Answer

in your first solution, reason the line’s wrapped is because you’re using d-sm-block, I believe d-sm-inline does the job.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement