WEB DESIGN GARAGE [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

WEB DESIGN GARAGE [Electronic resources] - نسخه متنی

Marc Campbell

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Changing the Default Color for Individual Link States


If your special link color needs to change depending on the state of the link, the style attribute of the anchor tag doesn't really help you out, since you need access to the pseudo-classes of the anchor tag. Not a problemjust create a special class style, like this:


<style type="text/css">
a.special:link {
color: #FF0000;
}
a.special:visited {
color: #CC0000;
}
a.special:active {
color: #990000;
}
a.special:hover {
color: #660000;
}
</style>
<body>
<a class="special" href=">See Our Specials</a>
<a class="special" href=">See More Specials</a>
</body>

In this example, you have four style rules for the four CSS link states, each corresponding to a different color. But all the style rules belong to the same classspecialso when an anchor tag joins the class, all four style rules apply. The state of the link determines which color appears, regardless of the default color for this state.


TIP


You don't have to give style rules for all four link states. Just define the states that apply to your link. If your special link needs to have separate visited and unvisited colors but not active or hover colors, then just create styles for the link and visited states. The default links on your page may have active and hover states, but they won't apply to your special class.


/ 175