473,386 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Inline css tags: need to add link color and hover over behavior

I need to use an inline css tag for a few links that will not behave like
the a:link and a:hover attributes in my stylesheet. I want to add a special
link color with underline and a mouseover a:hover attribute to eliminate an
underline when underlined to a series of links . Wondering how possible
putting an inline style such as this to <a hreftag
thanks
Mar 21 '07 #1
5 40949
Els
Bubba wrote:
I need to use an inline css tag for a few links that will not behave like
the a:link and a:hover attributes in my stylesheet. I want to add a special
link color with underline and a mouseover a:hover attribute to eliminate an
underline when underlined to a series of links . Wondering how possible
putting an inline style such as this to <a hreftag
No, that's not possible in inline styles. But IIUC, you need one link
out of a list to have different styles on them. Just add a class, and
then use the class in the stylesheet to make the difference.

<a class="foo" href="....">some link</a>

a:hover{color:blue;}
a.foo:hover{color:pink;text-decoration:none;}

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Mar 21 '07 #2
Scripsit Bubba:
I need to use
No, you don't, you just want, and you should stop wanting.
an inline css tag
There are no css tags, inline or otherwise.
for a few links that will not behave
like the a:link and a:hover attributes in my stylesheet.
They are pseudo-classes, not attributes. Using consistently wrong terms
indicates that you haven't read good books or tutorials on CSS. There is
little hope of success with style sheets before you take some time to learn
the basics. Surely you can do a casual move in styling here and there
without understanding much (getting started with CSS is _very_ easy in a
sense), but you are past that when you want to style links.
I want to
add a special link color with underline and a mouseover a:hover
attribute to eliminate an underline when underlined to a series of
links .
Special link colors are just confusing. For usability, you need minimally
three colors for links in their different states, and naturally all these
must be clearly distinct from each other and from text color, and not too
far from typical default link colors. That's difficult enough. No reason to
make it more difficult by using "color coding" for special links. Use some
other properties for special links (bolding, different font, borders,
whatever).

Once you've decided on that, and once you've studied the basics of CSS (and
I don't mean foolish tutorials that start telling you how to remove
underlining of links and how to set font size in points), this will be
smooth sailing, like

<ul class="special"><li><a href="...">...</a></li>...</ul>

with

..special a { font-variant: small-caps; }
..special a:hover { text-decoration: none; }
Wondering how possible putting an inline style such as this
to <a hreftag
It's not possible.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 21 '07 #3
On 21 Mar, 00:27, "Bubba" <1...@2.comwrote:
I need to use an inline css tag for a few links that will not behave like
the a:link and a:hover attributes in my stylesheet.
Yes, just do it.

* It's not valid.

* It usually works anyway,

* I assume you meant a <styletag to embed a CSS stylesheet, not
"inline CSS" (which is different)
Really you ought to place such things in the <headof the HTML
document, either as an internal or external stylesheet. I can only
assume here that you're stuck with some sort of blog where you don't
have access to <head>.

Mar 21 '07 #4
Scripsit Andy Dingley:
I can only
assume here that you're stuck with some sort of blog where you don't
have access to <head>.
That's a wild guess, but who knows, these days? People get blogged for no
reason, good or bad.

There's still always the option of doing something useful, possibly in the
form of authoring one's own content for the World Wide Web and maybe styling
it a little.

If you're stuck with some mode of authoring where you are expected to style
pages without being able to affect the <head(or CSS files referred to in
the the <head>), make sure you get paid _well_ for that misery.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 21 '07 #5
On 21 Mar, 11:18, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
If you're stuck with some mode of authoring where you are expected to style
pages without being able to affect the <head(or CSS files referred to in
the the <head>), make sure you get paid _well_ for that misery.
Oh, I did 8-)

I've just realised that the page is still up, 3 years later (I
thought it died a year ago)
<http://www.msngamecentre.co.uk/PageSource/index-promo-UK.aspx>

My embedded chunk is here: <div class="MSN-fragment-container"and
inside it
It's more or less as I left it, although a few bits of cruft have
crept in since.

Mar 21 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: LRW | last post by:
Below I'll paste my CSS and the HTML in question. But what's happening is, I'm trying to establish a link behavior for a class that's separate from the normal link class. I've established a: 's...
5
by: Colin Jones | last post by:
I'm trying to use CSS for menu buttons, but am unsure how to specify the width of blocks when displaying them inline. At the moment I am using SPAN tags, and IE renders the WIDTH property, but I...
33
by: Philip Herlihy | last post by:
I'm creating a common navigation bar of text "buttons" using CSS. On each page, I want the corresponding button to be "inert" (no hover, etc) as a visual clue to where you are. I thought I'd...
3
by: Mitch A | last post by:
What are the advantages of using inline C# code in my aspx pages (with inline I mean directly in the html between <% %>) versus code behind. It seems messy and inelegant to have code in both...
0
by: Manfred Kooistra | last post by:
I have positioned a text link over an image, and when I hover over the link, in Firefox a 1px-wide text-high white bar appears immediately to the left of the first letter of this link. CSS for the...
3
by: DC | last post by:
Given: a { text-decoration:none; } a:hover { text-decoration:underline; }
5
by: Viken Karaguesian | last post by:
Hello all, It seems to me that IE ignores other styles altogether when an inline style is used. As an example, check my site (in my signature file). In the "Latest News and Headlines" you can...
4
by: Andreas Borutta | last post by:
Hi, what is the task with which I could not cope? There is a link with an inline-element (strong e.g.) inside. It has a higher font-size than the content of its parent. For the hover effect...
8
by: azjudd | last post by:
Thank you in advance for your help on this one. I'm using named anchor tags on a FAQ page with questions listed at the top and answers below; a standard jump-to feature. However, anytime an anchor...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.