Martin Palmer
Martin Palmer

Reputation: 75

duplicate title tags?

Hi i am trying to style a title tag it works but it is coming up in the browser twice the one i styled and the preset one as well.

any ideas ? here's my code

Thanks all.

<a href="contact.php" class="test" title="CONTACT US!"></a>

a[title]:hover:after {
  content: attr(title);
  padding: 4px 8px;
  color: #333;
  position: absolute;
  right:23%;
  top: 70%;
  white-space: nowrap;
  /*z-index: 20px;*/
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  border-radius: 5px;
  -moz-box-shadow: 0px 0px 4px #222;
  -webkit-box-shadow: 0px 0px 4px #222;
  box-shadow: 0px 0px 4px #222;
}

Upvotes: 1

Views: 348

Answers (1)

Guffa
Guffa

Reputation: 700342

That's because you can't style the title, as it's not an element.

Each browser handles the title attribute in their own way, it can either show it on hover, not show it, or do something completely different...

What the code does is to create additional content that is shown, and that doesn't stop what the browser normally does with the title.

If you don't want the browser to show the title, don't use the title attribute. Use some other attribute that you know that the browser doesn't show.

Upvotes: 2

Related Questions