HighDots Forums  

selection pseudoclasses in Internet Explorer?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss selection pseudoclasses in Internet Explorer? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tomasio
 
Posts: n/a

Default selection pseudoclasses in Internet Explorer? - 06-24-2004 , 11:36 AM






hi all,

As I want the color of a:link inside the footer of my page
(http://tomasio.laudatio.com/jobs/Cla...d_beauty.html),
I selected it as descendant element of the div:

here's the code (or visit
http://tomasio.laudatio.com/jobs/Cla...stylesheet.css)

div.Footer a {
color: #f9bddb;
text-decoration: none;
}

a:link {color: #9C1350; text-decoration: none;}
a:visited {color: #9C1350; text-decoration: none;}
a:hover {text-decoration: underline; background-color: #E181AD;
}
a:active {color: Maroon; text-decoration: none;}

---

In Mozilla the color of the link inside div.Footer changes as
expected, but IE seems to ignore this. Is there a way how to achieve
the color change in IE also?

TIA,
--
kind regards,
tomasio
"describing an issue reveals the way to solve it"

Reply With Quote
  #2  
Old   
Philipp Lenssen
 
Posts: n/a

Default Re: selection pseudoclasses in Internet Explorer? - 06-24-2004 , 12:02 PM






tomasio wrote:

Quote:
here's the code (or visit
http://tomasio.laudatio.com/jobs/Cla...stylesheet.css)

div.Footer a {
color: #f9bddb;
text-decoration: none;
}

a:link {color: #9C1350; text-decoration: none;}
a:visited {color: #9C1350; text-decoration: none;}
a:hover {text-decoration: underline; background-color: #E181AD;
}
a:active {color: Maroon; text-decoration: none;}

Not sure what you want to do, but something like this might be a
solution:

a:link,
a:visited,
a:hover,
a:active
{
...
}

a:hover
{
...
}

a.Footer:hover,
a.Footer:link,
a.Footer:visited,
a.Footer:active
{
...
}

Note that CSS is case-sensitive so it must be <div
class="Footer">...</div> in your HTML as well.

--
Google Blogoscoped
http://blog.outer-court.com


Reply With Quote
  #3  
Old   
Steve Pugh
 
Posts: n/a

Default Re: selection pseudoclasses in Internet Explorer? - 06-24-2004 , 12:09 PM



tomasio <damnit (AT) jan (DOT) et> wrote:

Quote:
As I want the color of a:link inside the footer of my page
(http://tomasio.laudatio.com/jobs/Cla...d_beauty.html),
I selected it as descendant element of the div:

here's the code (or visit
http://tomasio.laudatio.com/jobs/Cla...stylesheet.css)

div.Footer a {
color: #f9bddb;
text-decoration: none;
}

a:link {color: #9C1350; text-decoration: none;}
a:visited {color: #9C1350; text-decoration: none;}
a:hover {text-decoration: underline; background-color: #E181AD;
}
a:active {color: Maroon; text-decoration: none;}
Always set color and background-color together to avoid clashes with
user stylesheets.

Quote:
In Mozilla the color of the link inside div.Footer changes as
expected, but IE seems to ignore this. Is there a way how to achieve
the color change in IE also?
Same colour in IE6, Opera 7 and Mozilla 1.6. Which version of IE on
which OS is giving you a problem?

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #4  
Old   
tomasio
 
Posts: n/a

Default Re: selection pseudoclasses in Internet Explorer? - 06-24-2004 , 12:50 PM



"Philipp Lenssen" <info (AT) outer-court (DOT) com> schrieb:

Quote:
Not sure what you want to do, but something like this might be a
solution:

a:link,
a:visited,
a:hover,
a:active
{
...
}

a:hover
{
...
}

a.Footer:hover,
a.Footer:link,
a.Footer:visited,
a.Footer:active
{
...
}

Note that CSS is case-sensitive so it must be <div
class="Footer">...</div> in your HTML as well.
Hi philipp,

thank you for your quick response. what i want is to give the
hyperlinks in div.Footer another color than the links in the rest of
the document. regarding to the book of eric meyer (CSS - Definitive
Guide) your approach is correct, but it does not work: neither in
mozilla nor in IE. maybe it has to do something with the cascade, or
that div.Footer is nested in another div?

Most be some stupid issue
--
kind regards,
tomasio
"describing an issue reveals the way to solve it"


Reply With Quote
  #5  
Old   
Els
 
Posts: n/a

Default Re: selection pseudoclasses in Internet Explorer? - 06-24-2004 , 12:59 PM



tomasio wrote:

Quote:
"Philipp Lenssen" <info (AT) outer-court (DOT) com> schrieb:

Not sure what you want to do, but something like this might
be a solution:

a:link,
a:visited,
a:hover,
a:active
{
...
}

a:hover
{
...
}

a.Footer:hover,
a.Footer:link,
a.Footer:visited,
a.Footer:active
{
...
}

Note that CSS is case-sensitive so it must be <div
class="Footer">...</div> in your HTML as well.

Hi philipp,

thank you for your quick response. what i want is to give
the hyperlinks in div.Footer another color than the links
in the rest of the document. regarding to the book of eric
meyer (CSS - Definitive Guide) your approach is correct,
but it does not work: neither in mozilla nor in IE. maybe
it has to do something with the cascade, or that div.Footer
is nested in another div?

Most be some stupid issue
The thing is that a.Footer:link, is not saying anything about
an a element inside a div with class="Footer".

a.Footer means an a element with class="Footer".

If your code in html is like this:

<div class="Footer">
<a href="........">
</div>

Then you need this:

div.Footer a:link,
div.Footer a:visited,
div.Footer a:hover,
div.Footer a:active
{....}

HTH

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -


Reply With Quote
  #6  
Old   
Neal
 
Posts: n/a

Default Re: selection pseudoclasses in Internet Explorer? - 06-24-2004 , 01:02 PM



On Thu, 24 Jun 2004 18:50:56 +0200, tomasio <damnit (AT) jan (DOT) et> wrote:

Quote:
thank you for your quick response. what i want is to give the
hyperlinks in div.Footer another color than the links in the rest of
the document. regarding to the book of eric meyer (CSS - Definitive
Guide) your approach is correct, but it does not work: neither in
mozilla nor in IE. maybe it has to do something with the cascade, or
that div.Footer is nested in another div?
If you put the generic link styles after the classed or id'ed or div'ed
ones, they'll supercede. Be sure you have

a:link {}
a:visited {}
a:active {}
a:hover {}

and after it in the styles

div.class a:link {}
div.class a:visited {}
div.class a:active {}
div.class a:hover {}

The first style group changes all links to be something, the second
changes only links in <div class="class"> to be different.


Reply With Quote
  #7  
Old   
tomasio
 
Posts: n/a

Default Re: selection pseudoclasses in Internet Explorer? - 06-24-2004 , 01:15 PM



Hi Steve,

Thank you for your quick answer.
Quote:
Always set color and background-color together to avoid clashes with
user stylesheets.
I set the background-color of "div.Footer a" to "white" and this time
IE reacted correct. There was a white background behind the Link-text.

Quote:
In Mozilla the color of the link inside div.Footer changes as
expected, but IE seems to ignore this. Is there a way how to achieve
the color change in IE also?

Same colour in IE6, Opera 7 and Mozilla 1.6. Which version of IE on
which OS is giving you a problem?
I am using IE 6 under WinXP Prof. SP1. Are you sure that we are
talking about the same Link? I am referring to the "Top of Page"-Link
at the bottom of the page. The font-color should be a light pink and
thus brighter than its background. IE does the opposite and giving it
the color of the default a:link.

Strange thing, I still don't get the clue

--
kind regards,
tomasio
"describing an issue reveals the way to solve it"


Reply With Quote
  #8  
Old   
tomasio
 
Posts: n/a

Default Re: selection pseudoclasses in Internet Explorer? - 06-24-2004 , 01:23 PM



I got it! it was the correct ordering of pseudoclasses (div.Footer
a:link after a:link) that spoiled my CSS.

Thank you a lot,
you all safed my day ; )
--
kind regards,
tomasio
"describing an issue reveals the way to solve it"

Reply With Quote
  #9  
Old   
AT
 
Posts: n/a

Default Re: selection pseudoclasses in Internet Explorer? - 06-24-2004 , 07:04 PM



Neal <neal413 (AT) yahoo (DOT) com> wrote:

Quote:
If you put the generic link styles after the classed or id'ed or div'ed
ones, they'll supercede. Be sure you have

a:link {}
a:visited {}
a:active {}
a:hover {}

and after it in the styles

div.class a:link {}
div.class a:visited {}
div.class a:active {}
div.class a:hover {}

The first style group changes all links to be something, the second
changes only links in <div class="class"> to be different.
Are you saying that if you have the rulesets in this order:

Quote:
div.class a:link {}
div.class a:visited {}
div.class a:active {}
div.class a:hover {}
a:link {}
a:visited {}
a:active {}
a:hover {}
- they will not have exactly the same effect?

--
"You're too late, my dear!"


Reply With Quote
  #10  
Old   
Neal
 
Posts: n/a

Default Re: selection pseudoclasses in Internet Explorer? - 06-25-2004 , 12:21 AM



On 24 Jun 2004 16:04:42 -0700, Wolfgang Wildeblood
<wolfgangwildeblood (AT) yahoo (DOT) com.au> wrote:

Quote:
Neal <neal413 (AT) yahoo (DOT) com> wrote:

If you put the generic link styles after the classed or id'ed or div'ed
ones, they'll supercede. Be sure you have

a:link {}
a:visited {}
a:active {}
a:hover {}

and after it in the styles

div.class a:link {}
div.class a:visited {}
div.class a:active {}
div.class a:hover {}

The first style group changes all links to be something, the second
changes only links in <div class="class"> to be different.

Are you saying that if you have the rulesets in this order:

div.class a:link {}
div.class a:visited {}
div.class a:active {}
div.class a:hover {}
a:link {}
a:visited {}
a:active {}
a:hover {}

- they will not have exactly the same effect?

They SHOULD have the same effect - but there's no guarantee the browser
will respect the cascade. In this specific case it should be fine either
way, but it's smart to be logical just in case.


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.