Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Span with a href link not working

Working to put a href in a span class, but I cant get the href link to work.

<a href="../../public/bassengweb/logout">Logg ut<span class="label label-danger"></span></a>

Also the label-danger wont show up.

like image 803
user3185936 Avatar asked Dec 25 '22 10:12

user3185936


2 Answers

Link to working span - Bootply

That's because of this line in the CSS:

.label:empty{
  display:none;
}

If you write something between the span tags, it will work.

<a href="../../public/bassengweb/logout"><span class="label label-danger">Logg ut</span></a>

Although, it will look terrible with 'normal' bootstrap label when hovered, maybe do something like this:

<a href="../../public/bassengweb/logout">Logg ut</a><span class="label label-danger">Danger</span>
like image 162
Albzi Avatar answered Dec 27 '22 23:12

Albzi


This is the best way! It works easy and clean.

<span onclick="window.location.href='www.google.com';">text</span>

and then you can give it a class:hover for the color

like image 22
Hugo Avatar answered Dec 27 '22 23:12

Hugo