Eki 30
- Be careful when styling links if you’re using anchors. “If you use a classic anchor in your code (
<a name="anchor">) you’ll notice it picks up:hoverand:activepseudo-classes. To avoid this, you’ll need to either useidfor anchors instead, or style with a slightly more arcane syntax::link:hover, :link:active” [Dave Shea] - Define relationships for links. “The rel attribute is supposed to indicate a semantic link relationship from one resource to another.
a[rel~="nofollow"]::after {content: "\2620";color: #933;font-size: x-small;}a[rel~="tag"]::after {content: url(http://www.technorati.com/favicon.ico);}
- “These make use of the attribute selector for space separated lists of values. Any a element with a relationship containing those values will be matched. Links with the nofollow relationship will be followed by a dark red skull and crossbones (?) and those with the tag relationship will be followed by the Technocrati icon.” [Handy CSS]
- You can mark external links automatically. Many people make use of the non-standard
rel="external"relationship to indicate a link to an external site. However, adding that to each and every link is time consuming and and unnecessary. This style rule will place an north east arrow after any link on your site to an external site. [Handy CSS]
a[href^="http://"]:not([href*="smashingmagazine.com"])::after {content: "\2197";}
- You can remove dotted links with
outline: none;. To remove dotted links useoutline: none;
a:focus {outline: none;}
Kaynak: Smashingmagazine
Yorum Yazın
Yorum yapmak için giriş yapmalısınız.