There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
css in anchor tag..??


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
llckll's Avatar
Member with 70 posts.
 
Join Date: Apr 2004
Location: New Jersey
21-Jan-2005, 12:19 PM #1
css in anchor tag..??
<a href="http://www.linkhere.html"
style="text-decoration : none;"><font color=000066><B>LINK TITLE HERE</B></a>

is it possible to put in other css attributes in the <a> tag.

for example. when the user hovers over the link, can i change the color of the font?

thanks,
ck
Gazornenplat's Avatar
Senior Member with 106 posts.
 
Join Date: Dec 2004
Location: Xabia, Spain
Experience: 20 years of programming
21-Jan-2005, 03:45 PM #2
You can put other attributes in the style, but not change the link colour. You can do that through the onmouseover event

Ian
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
22-Jan-2005, 06:02 AM #3
You can do it like this:

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>anchor styles</title> <meta http-equiv="content-type" content="text/html;charset=utf-8"/> <meta http-equiv="content-style-type" content="text/css"/> <meta http-equiv="content-script-type" content="application/x-javascript"/> <meta http-equiv="content-language" content="en-us"/> <style type="text/css">
            div#example a:link, div#example a:visited {
                text-decoration: none;
                color: #000;
                background-color: #ccc;
                padding: 2px;
                border: 1px solid #000;
            }
            div#example a:hover {
                text-decoration: underline;
                color: #f00;
                background-color: #000;
                padding: 5px;
                font-weight: bold;
            }
        </style> </head> <body> <div id="example"><a href="http://www.google.com">Google</a></div> </body> </html>
Then all anchors inside the example div will be styled that way. If you prefer to have some of the links inside the div a different color, encase those links in a span tag and use the same type of method used for the div.
__________________
10 ? "a line as the unending horizon"
20 ? "a curve as the rolling hillside"
30 ? "a point as a distant bird"
40 ? "a ray as the rising sun"
run

Last edited by Shadow2531 : 22-Jan-2005 06:13 AM.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:30 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.