כיצד לשנות צבע קישור HTML.
שינוי צבע הקישור נעשה עם סגנון css:
<a href="../html-link.htm" style="color:red">Main page</a>
הקוד יפיק את הקישור הזה:
שינוי צבע הרקע של קישור נעשה עם סגנון css:
<a href="../html-link.htm" style="background-color:#ffffa0">Main page</a>
הקוד יפיק את הקישור הזה:
קוד CSS:
<style>
#link_bar a {
padding:15px; font-weight:bold; float:left; }
#link_bar a:link { color:#d0d0d0;
background-color:#0000a0; }
#link_bar a:visited { color:#c0c0c0;
background-color:#0000a0; }
#link_bar a:hover { color:#ffffff;
background-color:#000060; }
#link_bar a:active { color:#f0f0f0;
background-color:#00ff00; }
</style>
קוד HTML:
<div id="link_bar">
<a
href="html-anchor-link.htm">Anchor link</a>
<a
href="html-link-color.htm">Link color</a>
<a
href="../mailto.htm">Email link</a>
<a
href="html-image-link.htm">Image link</a>
<a
href="html-text-link.htm">Text link</a>
</div>
נוף:
#link_bar a הוא הסגנון עבור כל המצבים של הקישור.
#link_bar a:link הוא הסגנון של קישור רגיל.
#link_bar א: ביקר הוא סגנון הקישור שבו ביקר.
#link_bar a:hover הוא הסגנון של קישור מרחף בעכבר.
#link_bar a: פעיל הוא סגנון הקישור בלחיצה על ידי העכבר.
Advertising