How to remove underline from text hyperlink?

I got a problem in my css file, I used this following code:

text-decoration: none;

But still it doesnt have effect on text, for some reason I had to use java script for href link behind text. But I think so because of this issue text decoration doesn't has effect on the text. even I can't use different color on text like hover and mouse over color.

Here is code:

 $(function() 
{
$('.maincaptionsmall').wrapInner('<a href="http://google.com"></a>');
});

and here is html code:

<span class="maincaptionsmall">Home</span>

For your information I used text decoration none even inline of href code, but it doesn't has effect.

You can check this following link to see the page: [link]http://www.malayatourism.com/thisistest/testnowjobdoneperfectlywork/

I'm gonna remove underline from Home text and use different color for mouse over something like this:

:hover { color: yellow; }

Thanks in advance.


用这个

.maincaptionsmall a {text-decoration:none;}
.maincaptionsmall a:hover {color: yellow;}

试试规则

.maincaptionsmall a {
    text-decoration: none;
}

如果由于JS功能而引起的话,那么你可以尝试在你的JS使用内联的css

$(function() 
{
$('.maincaptionsmall').wrapInner('<a style="text-decoration:none;" href="http://google.com"></a>');
});
链接地址: http://www.djcxy.com/p/74614.html

上一篇: CSS Div链接文本加下划线

下一篇: 如何从文本超链接中删除下划线?