473,569 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Links and Classes

47 New Member
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 1337
Bruno43
16 New Member
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 Recognized Expert Expert
Do it this way:
.sidebar a:link
Sep 21 '07 #3
Michael7
47 New Member
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 Recognized Expert Expert
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 New Member
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
Michael7
47 New Member
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
1454
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 pet deprecation candidate? I have always thought `backticks` as repr has got to be the most useless feature around." -- Ville Vainio Peter...
0
1089
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 endomorphic classes. Roll-your-own classes can be called mesomorphic classes. Extension classes can be called paleomorphic classes. Then there's a...
0
323
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 http://mail.python.org/pipermail/python-list/2004-November/249134.html "Some people may actually want to drink poisoned kool-aid and join the great...
7
3329
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 not pink. All of my other "pink_links" are pink, but they don't link to anchors on the same page.
2
1520
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 different web pages. Is it possible? Thanks, Fabrizio
4
1372
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 page and green in another section of the same page. I am familiar with CSS and I know that I can use the a:link property to set one color for the...
15
2118
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 would like to add an icon to pdf links. I'm after something of the form a:link("*.pdf) { properties ... }
0
1301
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 classes are being excluded from the chm but this is resulting in broken links in declarations of other classes that inherit from or use this class. Is...
2
1207
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 proccessing) and then move the cursor to the links.an then click..Do you have any better way. i want to do it on the browser not with httprequest and...
0
1075
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 'everything's just fine here', but then they always do; I really must learn that language." - Tim Bray A variation on a classic problem: 5 Queens...
0
7633
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7941
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6320
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5247
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3680
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3669
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
971
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.