473,386 Members | 1,830 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.

change link colors in p class

hi,

i want to change my link colors in the p class="suchen":

That is my html:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//DE"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Lippelt-B&auml;ckereimaschinen</title>
</head>
<body>
<!-- ###DOCUMENT_BODY### START-->
<div id="logo"><div align="right"><a href="http://www.lippelt-back.com"
target="_self"><img src="http://lippelt-back.com/file$
<div id="container"><div id="top">###ROOTLINE###</div></div>
<div id="leftnav">###CONTENT-LINKS###</div>
<div id="rightnav">###NAVI_LINKS###<p class="happy"></p><p
class="suchen">###INFO###</p></div>
<div id="content">###CONTENT-RECHTS###</div>
<div id="footer">###copyright### ###LAST###</div>
<div id="counter"></div>
<!-- ###DOCUMENT_BODY### STOP-->
</body>
</html>
i tested different options, but i was not able to change only the link
colors in the p class="suchen".

any hints?

cu denny
Jul 23 '05 #1
18 10255
Denny Schierz wrote:
i tested different options, but i was not able to change only the link
colors in the p class="suchen".


p.suchen a:link { color: ...; }
p.suchen a:visited { color: ...; }
p.suchen a:hover { color: ...; }
p.suchen a:active { color: ...; }

--
Mark.
http://tranchant.plus.com/
Jul 23 '05 #2
On Thu, 30 Sep 2004 17:18:16 +0200, Denny Schierz <cu***@gmx.de> wrote:
hi,

i want to change my link colors in the p class="suchen":

That is my html:
Don't post HTML, post a URL to a page showing the issue. Your code didn't
even have an anchor element in the classed p element.
i tested different options, but i was not able to change only the link
colors in the p class="suchen".

any hints?


p.suchen a:link {color: blue;}
p.suchen a:visited {color: purple;}
p.suchen a:hover {color: green;}
p.suchen a:active {color: red;}

Jul 23 '05 #3

"Denny Schierz" <cu***@gmx.de> wrote in message
news:cj*************@news.t-online.com...
hi,

i want to change my link colors in the p class="suchen":

That is my html:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//DE"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Lippelt-B&auml;ckereimaschinen</title>
</head>
<body>
<!-- ###DOCUMENT_BODY### START-->
<div id="logo"><div align="right"><a href="http://www.lippelt-back.com"
target="_self"><img src="http://lippelt-back.com/file$
<div id="container"><div id="top">###ROOTLINE###</div></div>
<div id="leftnav">###CONTENT-LINKS###</div>
<div id="rightnav">###NAVI_LINKS###<p class="happy"></p><p
class="suchen">###INFO###</p></div>
<div id="content">###CONTENT-RECHTS###</div>
<div id="footer">###copyright### ###LAST###</div>
<div id="counter"></div>
<!-- ###DOCUMENT_BODY### STOP-->
</body>
</html>
i tested different options, but i was not able to change only the link
colors in the p class="suchen".


Would you like to tell us what you tried so we don't waste time duplicating
your own efforts?

Jul 23 '05 #4
hi,

Harlan Messinger schrieb:
Would you like to tell us what you tried so we don't waste time duplicating
your own efforts?


i tried somthing like that:

p suchen a:link {
color : #fd1613;
background : transparent;
text-decoration : none;
}

p suchen a:visited {
color : #fd1613;
text-decoration : none;
}

p suchen a:hover {
color : black;
text-decoration : underline;
}

p suchen a:active {
color : #e9e9e9;
text-decoration : none;
}

i've forgotten to set the point "." :-/

stupid error :-(

thanks a lot for helping

cu denny
Jul 23 '05 #5
Neal schrieb:
Don't post HTML, post a URL to a page showing the issue. Your code
didn't even have an anchor element in the classed p element.
sorry, i will do it in the future
p.suchen a:link {color: blue;}
p.suchen a:visited {color: purple;}
p.suchen a:hover {color: green;}
p.suchen a:active {color: red;}


thanks, it helps :-)
Jul 23 '05 #6
hi,

Mark Tranchant schrieb:
p.suchen a:link { color: ...; }
p.suchen a:visited { color: ...; }
p.suchen a:hover { color: ...; }
p.suchen a:active { color: ...; }


also for you, a big thank :-)

cu denny
Jul 23 '05 #7
On Thu, 30 Sep 2004 18:32:14 +0200, Denny Schierz <cu***@gmx.de> wrote:
hi,

Harlan Messinger schrieb:
Would you like to tell us what you tried so we don't waste time
duplicating
your own efforts?


i tried somthing like that:

p suchen a:link {
color : #fd1613;
background : transparent;
text-decoration : none;
}


Problem: How will this be recognized as a link? Recommend leaving
underline in, unless you otherwise make it painfully obvious these are
links.
Jul 23 '05 #8
hi,

Neal wrote:
Problem: How will this be recognized as a link? Recommend leaving
underline in, unless you otherwise make it painfully obvious these are
links.


you can see, how it looks:

http://www.lippelt-back.com/

you find it under the main menu on the right side. I change the colors so
everybody can see this links, without a underline. I use underline for
hover :-)

Did you find it painfull? but thanks for this hint :-)

cu denny
Jul 23 '05 #9
Denny Schierz <cu***@gmx.de> writes:
p suchen a:link {
color : #fd1613;
background : transparent;
text-decoration : none;
}

i've forgotten to set the point "." :-/


Apart from that, there's another problem.

You've specified a colour, but not a background colour [1] - so
there's a chance that there'll be problems with user colour settings.

[1] Transparent doesn't count, because that's the default anyway. I
*think* 'inherit' would work (and still do what you want), provided
there's a background colour set for something nearer the root element,
but I can't be certain - has anyone else tested inherit in these
conditions?

--
Chris
Jul 23 '05 #10
Chris Morris <c.********@durham.ac.uk> wrote in
news:87************@dinopsis.dur.ac.uk:
Denny Schierz <cu***@gmx.de> writes:
p suchen a:link {
color : #fd1613;
background : transparent;
text-decoration : none;
}

i've forgotten to set the point "." :-/


Apart from that, there's another problem.

You've specified a colour, but not a background colour [1] - so
there's a chance that there'll be problems with user colour settings.

[1] Transparent doesn't count, because that's the default anyway. I
*think* 'inherit' would work (and still do what you want), provided
there's a background colour set for something nearer the root element,
but I can't be certain - has anyone else tested inherit in these
conditions?

No that is not a problem. Transparent will override any user CSS for the
background and avoid problems with user color settings just fine. If the
underlying background color is not what the author expected (due to user
CSS, for instance), then it's the user's fault for not having a CSS file
that includes
* { color: inherit !important; background: inherit !important; }

If inherit works without problems, then transparent certainly will.
Jul 23 '05 #11
Sam Hughes <hu****@rpi.edu> writes:
Chris Morris <c.********@durham.ac.uk> wrote:
You've specified a colour, but not a background colour [1] - so
there's a chance that there'll be problems with user colour settings.

[1] Transparent doesn't count, because that's the default anyway. I
*think* 'inherit' would work (and still do what you want), provided
there's a background colour set for something nearer the root element,
but I can't be certain - has anyone else tested inherit in these
conditions?
No that is not a problem. Transparent will override any user CSS for the
background and avoid problems with user color settings just fine. If the
underlying background color is not what the author expected (due to user
CSS, for instance), then it's the user's fault for not having a CSS file
that includes
* { color: inherit !important; background: inherit !important; }


That's the last thing I'd put in a user CSS file! I do like having
some things (links, etc) a different colour...

author:
body { background: red; color: white; }
a { background: transparent; color: blue; }

user:
body { background: blue; color: white; }

Yes, the CSS rule you suggest above would fix this for the user, but
would also be a little extreme for the majority of user CSS files.
If inherit works without problems, then transparent certainly will.


And looking at this example, inherit wouldn't work either, so I was
wrong there. Both inherit and transparent are risky, then.

--
Chris
Jul 23 '05 #12
On Fri, 1 Oct 2004, Chris Morris wrote:
Sam Hughes <hu****@rpi.edu> writes:
No that is not a problem. Transparent will override any user CSS for the
background and avoid problems with user color settings just fine. If the
underlying background color is not what the author expected (due to user
CSS, for instance), then it's the user's fault for not having a CSS file
that includes
* { color: inherit !important; background: inherit !important; }


That's a bit strong, and wouldn't work for older CSS implementations,
but it's an interesting point of view. I haven't quite seen it put
that way before; I'd like to explore the idea more before deciding
on its implications.
That's the last thing I'd put in a user CSS file! I do like having
some things (links, etc) a different colour...


Oh, I'm sure Sam meant for that to take effect just where no
more-specific coloring had been used in the user stylesheet.

And, where higher-specificity user style properties are written,
explicit text colour should always be accompanied by explicit
background colour, and vice versa, just as the "traditional" design
rule taught.

Jul 23 '05 #13
Chris Morris <c.********@durham.ac.uk> wrote in
news:87************@dinopsis.dur.ac.uk:
Sam Hughes <hu****@rpi.edu> writes:
If the underlying background color is not what the author expected
(due to user CSS, for instance), then it's the user's fault for not
having a CSS file that includes
* { color: inherit !important; background: inherit !important; }
That's the last thing I'd put in a user CSS file! I do like having
some things (links, etc) a different colour...


I mean that would be at the top. Then it would get overruled as various
elements such as links got styled with their colors.

So I'll modify your quote by putting my little rule up top and changing
some things:

author:
* { color: inherit !important; background: inherit !important; }
body { background: red !important; color: white !important; }
a { background: transparent !important; color: blue !important; }

user:
body { background: blue; color: white; }

This results in white on red.
And looking at this example, inherit wouldn't work either, so I was
wrong there. Both inherit and transparent are risky, then.


Only if the user makes his style sheet poorly, which is his/her own
responsibility.
Jul 23 '05 #14
On 1 Oct 2004 12:24:31 GMT, Sam Hughes <hu****@rpi.edu> wrote:
* { color: inherit !important; background: inherit !important; }


!important in a author stylesheet only overrides author or user styles not
marked with !important. User !important will override everything.
Jul 23 '05 #15
Neal <ne*****@yahoo.com> wrote in
news:op**************@news.individual.net:
On 1 Oct 2004 12:24:31 GMT, Sam Hughes <hu****@rpi.edu> wrote:
* { color: inherit !important; background: inherit !important; }


!important in a author stylesheet only overrides author or user styles
not marked with !important. User !important will override everything.


That's pretty much the whole idea.
Jul 23 '05 #16
On 2 Oct 2004 00:10:00 GMT, Sam Hughes <hu****@rpi.edu> wrote:
Neal <ne*****@yahoo.com> wrote in
news:op**************@news.individual.net:
On 1 Oct 2004 12:24:31 GMT, Sam Hughes <hu****@rpi.edu> wrote:
* { color: inherit !important; background: inherit !important; }


!important in a author stylesheet only overrides author or user styles
not marked with !important. User !important will override everything.


That's pretty much the whole idea.


I see now, I misread. Well, the clarification was likely useful to
somebody...
Jul 23 '05 #17
Sam Hughes <hu****@rpi.edu> writes:
Chris Morris <c.********@durham.ac.uk> wrote in
news:87************@dinopsis.dur.ac.uk:
Sam Hughes <hu****@rpi.edu> writes:
If the underlying background color is not what the author expected
(due to user CSS, for instance), then it's the user's fault for not
having a CSS file that includes
* { color: inherit !important; background: inherit !important; }
That's the last thing I'd put in a user CSS file! I do like having
some things (links, etc) a different colour...


I mean that would be at the top. Then it would get overruled as various
elements such as links got styled with their colors.

So I'll modify your quote by putting my little rule up top and changing
some things:

author:
* { color: inherit !important; background: inherit !important; }


I note you've put this in the author CSS file - the impression I got
above was that you expected it in the user CSS.
body { background: red !important; color: white !important; }
a { background: transparent !important; color: blue !important; }

user:
body { background: blue; color: white; }

This results in white on red.


Well, obviously - author !important overrides user normal.
And looking at this example, inherit wouldn't work either, so I was
wrong there. Both inherit and transparent are risky, then.


Only if the user makes his style sheet poorly, which is his/her own
responsibility.


Bear in mind that user CSS is probably a lot rarer than changing the
default background/colour combinations in the browser - which only
affects body. (Unless 'ignore author colours' or the equivalent is
checked, in which case it makes absolutely no difference what's in the
author stylesheet [1].

[1] A couple of browser bugs notwithstanding.

--
Chris
Jul 23 '05 #18
Chris Morris <c.********@durham.ac.uk> wrote in
news:87************@dinopsis.dur.ac.uk:
Sam Hughes <hu****@rpi.edu> writes:
author:
* { color: inherit !important; background: inherit !important; }
I note you've put this in the author CSS file - the impression I got
above was that you expected it in the user CSS.


Oh right, I got mixed up.
Bear in mind that user CSS is probably a lot rarer than changing the
default background/colour combinations in the browser - which only
affects body. (Unless 'ignore author colours' or the equivalent is
checked, in which case it makes absolutely no difference what's in the
author stylesheet [1].

[1] A couple of browser bugs notwithstanding.


I notice that Mozilla will set the body background color, but then it will
make the backgrounds of other things transparent. This is bad for items
such as drop down menus - text gets overlapping.

Jul 23 '05 #19

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

Similar topics

5
by: Dan Jacobson | last post by:
What's Nielsen talking about in http://www.useit.com/alertbox/20040503.html http://www.useit.com/alertbox/20040510.html Can't a good browser keep track of visited vs. unvisited link colors? Is my...
12
by: jfburr | last post by:
very simple thing (I hope) I've got a css style sheet that starts like this: ______________ A:link { color: cc9933; }
18
by: Jan Tuxen | last post by:
Jakob Nielsen in his most recent Alertbox (http://www.useit.com/alertbox/20040503.html) tells web authors to change the color of visited links. I agree to his purpose: Help users understand...
9
by: michael | last post by:
I have many links on a page, but for example sake, these two: <a href="bla1.html" id="link1">bla1</a> <a href="bla1.html" id="link2">bla1</a> I use a Javascript function to change the link...
3
by: Mike Barnard | last post by:
Hi all, newbie here. Odd sounding subject but I can't describe it any better. I'm trying to teach myself a little about CSS. In a test site (not published) I am trying to use CSS to make...
4
by: Franklin | last post by:
WITHOUT KNOWING ANYTHING ABOUT THE CURRENT COLORS, I want to swap the foreground/background colors of a link when someone hovers over it. Is this possible with HTML, CSS, DOM, & JavaScript? If...
4
by: news.internode.on.net | last post by:
Is there any way that a STYLE attribute can be used to control the color of hyperlinks. We have a tabular output generator written in C#. Each column of the table is defined by a column, and...
5
by: Bubba | last post by:
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...
4
torquehero
by: torquehero | last post by:
hi, I am working with dreamweaver MX 2004. The problem is with Link colors (text). In page properties I have specified the link color, visited links, active links as #000000 and rollover links as...
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: 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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.