Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visible-lg still visible in xl #8

Open
stevehomer opened this issue Sep 13, 2016 · 2 comments
Open

visible-lg still visible in xl #8

stevehomer opened this issue Sep 13, 2016 · 2 comments

Comments

@stevehomer
Copy link

stevehomer commented Sep 13, 2016

Lovely idea but first test I did failed.

        <span class="visible-lg">&nbsp; lg</span>
        <span class="visible-md">&nbsp; md</span>
        <span class="visible-sm">&nbsp; sm</span>
        <span class="visible-xs">&nbsp; xs</span>
        <span class="visible-xl">&nbsp; xl</span>

All works fine but when you get to xl size the lg is still visible.

Solution is to add

/smh add/

.visible-lg-block,
.visible-lg-inline,
.visible-lg-inline-block,
.visible-lg{
    display: none !important;
}

/END smh/

at the end of the second (main) media query section.

I have done my first Pull request - not sure I did it right. We will see.

ATB Steve

@samc449
Copy link

samc449 commented Sep 15, 2017

I've discovered an oversight with the use of !important mentioned above.

It prevents you from using two visible classes such as visible-xs AND visible-xl on the same element.
Using display: none!important overrides all breakpoints so only the XL breakpoint would show.

Update:
I'm wrong about !important. Bootstrap use this for the default visible classes so it's not that. I think it might be a problem with the passing order...


In the screenshot below my window is set to a SM breakpoint. You can see that the .visible-sm class is being overridden by the styles added above.

screen shot 2017-09-15 at 11 24 52


BUT if you compare that to two bootstrap classes instead of using the .visible-xl class you can see that the .visible-sm class is not overridden.

screen shot 2017-09-15 at 11 38 55

How do we fix this?

@N6REJ
Copy link

N6REJ commented Jul 24, 2022

.visible should be .hidden else you'll never see the css effects as I've told it not too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants