Please help! (CSS)
One of the reasons i haven't really got going with CSS is that seemingly easy stuff goes wrong for me (i appreciate i might be the deciding factor in this). I have an example for you which i really need to fix!
If you visit this page you will see one of the menu items is underlined, but in the style sheet it defines no decoration on links until hovered over. So how comes that one bugger doesn't play ball?
Here is the link to the stylesheet:
http://www.sarahspetportraits.co.uk/style.css
(The menu uses H2)
Thanks,
-Rob
robfenn posted this at 11:00 — 20th October 2005.
He has: 471 posts
Joined: Jun 2005
Just noticed this is in the wrong section. Can someone move it to web page authoring?
The Webmistress posted this at 12:11 — 20th October 2005.
She has: 5,586 posts
Joined: Feb 2001
H1 & H2 are headings and should be that, not links. Style your links (a, a:hover, a:active) to act as you want them or create a class for styling the navigation separately from other links on the page.
Julia - if life was meant to be easy Michael Angelo would have painted the floor....
robfenn posted this at 12:28 — 20th October 2005.
He has: 471 posts
Joined: Jun 2005
Julia,
If you look at the style sheet link, hover and active are both defined as "text-decoration: none" Which should mean they are not underlined.
I know it shouldn't be called H2, lazyness on my part, but does that actually make a difference?
Thanks,
-Rob
webs posted this at 13:11 — 20th October 2005.
They have: 2 posts
Joined: Oct 2005
Hi.
I just looked at your css-file.
You might want to check line nr. 11:
h2 a:hover {color: #413833; text-decoration: underline}
This is probably why you get the links underlined...
B
Megan posted this at 13:28 — 20th October 2005.
She has: 11,421 posts
Joined: Jun 1999
It's because all of the other links are pointing to the current page and therefore showing up as visited links which has the text-decoration:none applied. The link definition does not have the text-decoration applied specifically - it's applied to the H2 tag which gets overriden by the default settings for the a tag.
I agree that it would be best to create a class for this rather than relying on the H2 tag.
Megan
Connect with us on Facebook!
robfenn posted this at 14:09 — 20th October 2005.
He has: 471 posts
Joined: Jun 2005
Well done guys! Works now
robfenn posted this at 11:34 — 21st October 2005.
He has: 471 posts
Joined: Jun 2005
Sorry to annoy you again but i'm having more troubles...
Both Firefox and Opera are ignoring my P class styles, making the links the default blue. If Internet Explorer is so bad then why does it display everything as i intended?
Here is a link:
http://www.sarahspetportraits.co.uk/pet-portrait-portfolio.htm
And the stylesheet again:
http://www.sarahspetportraits.co.uk/style.css
Thanks in advance.
-Rob
Renegade posted this at 11:50 — 21st October 2005.
He has: 3,022 posts
Joined: Oct 2002
Um... You have this:
h4 {font-family: arial; font-size: 9pt; color: #413833}; text-decoration: none;}
This happens several times in your code, try changing it to this:
h4 {font-family: arial; font-size: 9pt; color: #413833; text-decoration: none;}
robfenn posted this at 14:36 — 21st October 2005.
He has: 471 posts
Joined: Jun 2005
I could kiss you.
demonhale posted this at 14:43 — 21st October 2005.
He has: 3,278 posts
Joined: May 2005
hey rob theres actually a css tidy tool that checks for your CSS or go to the CSS validation service and it will validate your CSS file and will show you some errors you missed... Good to know youre keen on learning CSS...
robfenn posted this at 15:01 — 21st October 2005.
He has: 471 posts
Joined: Jun 2005
Yeah, shame i'm lame at it! I'm not a born coder i'm afraid.
I will endeavour to improve though, i might do a course or something.
Should of though of using the W3C Validator, duh!
Cheers
-Rob
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.