Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Links not active in firefox with bootstrap buttons

I ran into a strange issue while building my wordpress site. All links that are inside the bootstrap buttons are not active in firefox.

What could cause this?

Here's the html output:

<button class="btn pull-right" role="button">
<a href="http://domain.dev/?cat=4" name="View all News">
    All News
</a>
</button>

Here's the css:

.home #primary #home-more .btn {
background-image: url("../img/home-button-sprite-more.png");
background-repeat: no-repeat;
margin-right: 0px;
background-color: transparent;
padding: 13px 40px;
background-position: 20px 0px;
}
button.btn {
display: inline-block;
padding: 13px 24px; 
margin-bottom: 0px;
margin-right: 10px;
font-size: 10px;
text-transform: uppercase;
font-weight: bold;
line-height: 1;
text-align: center;
vertical-align: middle;
cursor: pointer;
border: medium none;
border-radius: 0px 0px 0px 0px;
white-space: nowrap;
-moz-user-select: none;
}
like image 237
Bojana Šekeljić Avatar asked Oct 07 '13 06:10

Bojana Šekeljić


People also ask

Can we use anchor inside button?

We can style an anchor tag to look like a button using CSS. This is the default HTML styling for an anchor tag. We can add a class to the anchor tag and then use that class selector to style the element. Now we have an anchor tag that looks like a button.

Can I use a tag inside button?

Inside a <button> element you can put text (and tags like <i> , <b> , <strong> , <br> , <img> , etc.). That is not possible with a button created with the <input> element! Tip: Always specify the type attribute for a <button> element, to tell browsers what type of button it is.

How do you add an inside button?

Using button tag inside <a> tag: This method create a button inside anchor tag. The anchor tag redirect the web page into the given location. Adding styles as button to a link: This method create a simple anchor tag link and then apply some CSS property to makes it like a button.


2 Answers

Instead of,

<button class="btn pull-right" role="button">
<a href="http://domain.dev/?cat=4" name="View all News">
    All News
</a>
</button>

You have to use,

<a href="http://domain.dev/?cat=4" name="View all News">
  <button class="btn pull-right" role="button">
    All News
  </button>
</a>

Or,

<a href="http://domain.dev/?cat=4" title="View all News" class="btn pull-right">
    All News
</a>
like image 189
Anshad Vattapoyil Avatar answered Sep 28 '22 07:09

Anshad Vattapoyil


Try what @Devo has suggested else try this

<a class="btn btn-primary" href="http://domain.dev/?cat=4">All News</a>

Hope this helps.

like image 33
jayeshkv Avatar answered Sep 28 '22 08:09

jayeshkv