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 a: ਵਿਜ਼ਿਟ ਕੀਤੇ ਗਏ ਲਿੰਕ ਦੀ ਸ਼ੈਲੀ ਹੈ।
#link_bar a:hover ਮਾਊਸ ਹੋਵਰ ਕੀਤੇ ਲਿੰਕ ਦੀ ਸ਼ੈਲੀ ਹੈ।
#link_bar a: ਸਰਗਰਮ ਲਿੰਕ ਦੀ ਸ਼ੈਲੀ ਹੈ ਜਦੋਂ ਮਾਊਸ ਦੁਆਰਾ ਦਬਾਇਆ ਜਾਂਦਾ ਹੈ।
Advertising