开发者

customizng link using css

开发者 https://www.devze.com 2023-03-01 03:09 出处:网络
I have a link with the following format: a:link { color: #034af3; } a:editedLink { color: #FFFFFF; } along with the above I want to have a link with the following and I want to use both of them in

I have a link with the following format:

        a:link
    {
        color: #034af3;
        }

    a:editedLink
{
    color: #FFFFFF;
}

along with the above I want to have a link with the following and I want to use both of them in my page depending upon my r开发者_如何学Cequirement. How can I do the above?


Your question is not clear.

There are some pseudo classes in css for links

they are

a:link {color:#FF0000;}      /* unvisited link */
a:visited {color:#00FF00;}  /* visited link */
a:hover {color:#FF00FF;}  /* mouse over link */
a:active {color:#0000FF;}  /* selected link */

Pseudo-classes can be combined with CSS classes like

a.red:visited {color:#FF0000;}
<a class="red" href="css_syntax.asp">CSS Syntax</a>

If this is not you want ,pls explain a bit further


You can't set :whateverYouLike.

:link, :visited, :hover, :active ar reserved css pseudo classes/selectors.

If you want your own styling, use css classes. Like:

<a href="#" class="editedLink">LinkText</a>

plus css definition:

.editedLink {color:#FFF;}


a:link, a:visited, a:hover, a:active{
    color: #034af3;
}

a.editedLink{
    color: #FFFFFF;
}

<a href="/link" class="editedLink">Text</a>
<a href="/link">Text</a>
0

精彩评论

暂无评论...
验证码 换一张
取 消