473,396 Members | 2,018 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,396 software developers and data experts.

Links and Classes

Hi everyone,

I've been asking many questions . . . and have yet another one!

I've been trying to do something as simple as changing a link color in a class, but it's not working for me.

The CSS code is:
Expand|Select|Wrap|Line Numbers
  1. .sidebar {
  2. position:       absolute;
  3. width:          165px;
  4. top:            0px;
  5. left:           5px;
  6. border-right:    1px solid;
  7. }
  8.  
  9. a.sidebar:link {color:white;}
  10.  
  11. a.sidebar:visited {color:white;}
Everywhere I look as I learn CSS, it appears this should work! I tried simply to have "a.sidebar {color: white}" to change all link attributes instead of specifying each individual one like link, visited, hover, active. But that wasn't working, so to be safe I just did the above code for testing purposes. But still nothing is working.

The section of the page code is,

Expand|Select|Wrap|Line Numbers
  1. <div class="sidebar">Test Test Test Test Test Some Text for Testing, and some more and more and more and more and more and more and more and are you <a href="workmenforChrist.org">Link</a> reading this and this and this and how about some of this, did you catch that and this and some more and some more text and test text?</div>
Shouldn't this work? Or am I supposed to put a class in the link tag itself as well? I tried doing something like that before and that still didn't work. So . . . what in the world am I missing?!

Thanks in advance for your help . . . I do appreciate it. And I really appreciate the patience of those who have been helping me in my other threads too!

~Michael
Sep 21 '07 #1
6 1332
Bruno43
16
Try this

Expand|Select|Wrap|Line Numbers
  1. .sidebar a:link, .sidebar a:visited{color:#ffffff;}
Try to find a good article describing how the Cascade works in 'Cascading Style Sheets'

First you want to go into your class .sidebar then you want your anchor links (a) inside the sidebar to be colored white, same with your visited.

Also try using the RGB code for the color it is good practice.

Hope this helps :)
Sep 21 '07 #2
drhowarddrfine
7,435 Expert 4TB
Do it this way:
.sidebar a:link
Sep 21 '07 #3
Ah, thanks for the help!

I thought I saw something about that, and tried it also. But I realize what I did wrong . . . I tried putting it inside the brackets instead of on the outside.

Sheesh, it's always something simple with me haha . . .

Thanks again for the help, both of you!
Sep 21 '07 #4
drhowarddrfine
7,435 Expert 4TB
Don't feel bad. When I was learning all this I did the same things. You get tense, in a hurry, and just don't notice things. Even now, I find it better to just step away from the computer and it'll come to me.
Sep 21 '07 #5
Bruno43
16
Same, I still mess up linking my style sheet and im like ..... why isn't anything working?!?!?!?!??$#%!$!$! ... O ..... then I feel stupid
Sep 21 '07 #6
haha, thanks . . . At least I know I'm not the only one then. It seems every time I try to update/upgrade with using different code . . . not even the simplest of things work for me. Same with you also, it seemed, :)
Sep 21 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Emile van Sebille | last post by:
QOTW: "I've tried many ways over the years to represent equations legibly using Python and my experience that case sensitivity, while certainly no panacea, helps." -- Tim Hochberg "What's your...
0
by: John J Lee | last post by:
QOTW: "I'd love it if we could come up with a different term for these beasts than 'new style classes'." --Barry Warsaw "Then let me suggest ectomorphic classes, as opposed to the previous...
0
by: Cliff Wells | last post by:
QOTW: "I find it hard to believe nobody has tried this yet, unless it's the case that those who know how to do it also know that it's actually not possible for some reason..." -- Peter Hansen...
7
by: Will Hartung | last post by:
I have this: <a class="pink_link" href="faq.html#q1">Go to question 1</a> And the CSS is simply: ..pink_link {color: #fa61b7; font-weight: bold;} So, I'm curious why my links are blue and...
2
by: Fabrizio | last post by:
Hi, I'm trying to deal with ASP.NET and i would like to know if there is any control or any method that allows me, like in JAVA classes, to have, for example, scrolling news with links to...
4
by: Paul | last post by:
Not sure if this is the right place for a CSS question but I saw some other CSS posts so here goes a pretty basic question. I want the color of an HTML link to be blue on one section of my HTML...
15
by: Roedy Green | last post by:
I seem to recall reading about a feature so that you could apply different styles to different kinds of link. e.g. local and offsite or to automatically put a logo beside some domain links. I...
0
by: GM | last post by:
Hello, I am using NDoc version 1.3.1 (MSDN documenter) to generate class documentation for my class libraries. I am using the <exclude/tag on the classes that should not be documented. The...
2
by: Hakan Fatih YILDIRIM | last post by:
Hi List, Ä° want make a windows app that will detect and click links on the browser.For doing this i thought like this. grabbing the screen and then detect the locations of the links(image...
0
by: Gabriel Genellina | last post by:
QOTW: "However, inspection of a vast corpus of code might lead one to believe that any commenting capability was completely unnecessary." - Jim B. Wilson "The Python people also piped to say...
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: 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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.