Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabled a list-group-item in Bootstrap 3.0

I've been using the bootstrap 3.0 and I was wondering how can I disable a list-group-item.

What I tried was to put the disabled atribute in the "a" tag but this not had any effect. I also tried to add the disabled class with the same result.

Here some example:

<div class="list-group">
  <a href="#" class="list-group-item">Add New entry</a>
  <a href="#" class="list-group-item disabled">Delete Entry</a>
</div>

Thanks

like image 290
Juan Jardim Avatar asked Oct 17 '13 13:10

Juan Jardim


People also ask

What is list Group flush?

list-group-flush to remove some borders and rounded corners to render list group items edge-to-edge in a parent container (e.g., cards).

How can you add a badge to a list group in bootstrap?

Add the badges component to any list group item and it will automatically be positioned on the right. Just add <span class = "badge"> within the <li> element.

What is list-unstyled bootstrap?

list-unstyled class removes the default list-style and left padding only from the list items which are immediate children of the <ul> or <ol> element.

What is the use of list Group in bootstrap?

List Groups are used to display a series of content. We can modify them to support any content as per our needs. The use of List-Groups is just to display a series or list of content in an organized way.


1 Answers

In Bootstrap there are disabled states for froms, navbars links, nav links, dropdownlinks.

I think the disable state of the navs best fits your situation: http://getbootstrap.com/components/#nav-disabled-links

Copy this disable state for your list-group:

Less:

.list-group  > a.disabled  {
      color: @nav-disabled-link-color;

      &:hover,
      &:focus {
        color: @nav-disabled-link-hover-color;
        text-decoration: none;
        background-color: transparent;
        cursor: not-allowed;
      }
    }

Css:

.list-group > a.disabled {
  color: #999999;
}
.list-group > a.disabled:hover,
.list-group > a.disabled:focus {
  color: #999999;
  text-decoration: none;
  background-color: transparent;
  cursor: not-allowed;
}

Example: http://bootply.com/88367

like image 158
Bass Jobsen Avatar answered Oct 16 '22 15:10

Bass Jobsen