Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do my bootstrap labels and badges disappear on my samsung s3

My bootstrap labels and badges disappear off the webpage when the page loads for the first time, using my samsung galaxy s3 they only reappear after when I refresh the browser window. Why is this happening and how can I simply force them to appear the first time the page loads please. My labels and badges are not empty, so the display none function has nothing to do with it.

An example of the code as it is that does not display the first time the page loads is:

    <span class="badge badge-important">info</span>

also tried to remove below with no luck

    .label:empty,
    .badge:empty { display: none; }

The normal boostrap.css is attached to my page and its the only style sheet that has the label selector in it.

Has anyone come across this weird sort of thing?

Thanks

like image 798
user2012742 Avatar asked Mar 28 '13 20:03

user2012742


People also ask

What is Bootstrap badge?

Introduction: In Bootstrap v5, Badges are simple and basic components that are used to display an indicator or count a number. This is quite useful for mail count and alerting purposes, among other things. Badges are identical to labels, with the exception that they have more rounded corners.

Which class is used to create a badge in Bootstrap?

Bootstrap Badges are numerical indicators used to show that how many items are associated with the specific link. Badges are used to highlight new or unread items. The class . badge within the <span> element is used to create badges.

What is the Bootstrap component which can be used as a small indicators?

Badges can be used as part of links or buttons to provide a counter.


1 Answers

Okay, had this problem on a Samsung Galaxy Note tablet, an LG Optimus phone, and an LG Nexus phone. When I removed the below code from the bootstrap CSS file completely, the problem went away.

Remove:

.label:empty,
.badge:empty { display: none; }

Looks like the Samsung/LG browser ignores the :empty and just makes the .label and .badge display:none whether it's empty or not.

I know that the original questioner said that he tried this and it didn't work (cache issue maybe???), but it did work for me, so I thought I'd at least post the answer since this was the #1 google result when I ran into the problem.

like image 132
Kevin Nelson Avatar answered Oct 17 '22 10:10

Kevin Nelson