Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-10-12 09:25:54
- digicammad
- Member
- Registered: 2005-10-11
- Posts: 71
Link colours
Hi
Sorry if this is a dumb question, I’m a newbie to CSS and even newer to Textpattern. I’ve searched the forums and textbook and can’t find the answer. I’m trying to change the colour of my link list, but no matter what I try with the stylesheet it just stays the same colour as the main page background. Can anybody point me in the right direction please?
Cheers
Offline
#2 2005-10-12 10:37:02
- Anark
- Member
- Registered: 2004-08-14
- Posts: 101
Re: Link colours
Try something along the lines of
<code>
a:link {
text-decoration: none;
color: #00f;
background: transparent;
}
a:visited {
text-decoration: none;
color: #888;
background: transparent;
}
a:active {
text-decoration: none;
color: #f00;
background: transparent;
}
a:hover {
text-decoration: underline;
color: #03c;
background: transparent;
}</code>
Whereby a:link stands for the univisited link a:visited for the visited link a:active for the link you’ve just clicked on and a:hover for the link under your mouse pointer. The “text-decoration” for some weird reason stands for the underlining or absence thereof.
Offline
#3 2005-10-12 10:45:14
- digicammad
- Member
- Registered: 2005-10-11
- Posts: 71
Re: Link colours
Thanks. That changes the attributes of any free standing links, but the ones in the <txp:link_list> and <txp:section_list> are still the same. I can’t find anything about changing these.
Offline
#4 2005-10-12 10:47:14
- Anark
- Member
- Registered: 2004-08-14
- Posts: 101
Re: Link colours
Wait — link list you say? The link list is likely to be in a sidebar. Here’s a quote, I believe, from the out-of-the-box TxP styles.
<code>#sidebar-2 a, #sidebar-1 a
{
border: 0px;
color: #f00;
}</code>
This is what makes the sidebar links red in an uncustomised TxP install. The “a” stands for links, and “#sidebar-2 a” means “apply the following to all links found within the sidebar-2 id”.
Offline
#5 2005-10-12 10:49:30
- digicammad
- Member
- Registered: 2005-10-11
- Posts: 71
Re: Link colours
Oh okay, I didn’t know the a stood for links. Thanks, I’ll give that a go.
Offline
#6 2005-10-12 11:09:24
- digicammad
- Member
- Registered: 2005-10-11
- Posts: 71
Re: Link colours
Still not doing it, but I’ll plug away. So does the # in front of the class name indicate the definition of an an attribute of the class?
Offline
#7 2005-10-12 11:14:24
- Anark
- Member
- Registered: 2004-08-14
- Posts: 101
Re: Link colours
Well, I guess it’s the same a as in the a href that makes a link tag.
I always figured the href stood for something like hyper-reference and the a stood for, um, er — an indefinite article?
Whatever.
Offline
#8 2005-10-12 11:17:00
- digicammad
- Member
- Registered: 2005-10-11
- Posts: 71
Re: Link colours
lol.
Thanks again.
Offline
Re: Link colours
Useless trivia: the “a” stands for “anchor”.
You cooin’ with my bird?
Offline
#10 2005-10-12 11:38:53
- digicammad
- Member
- Registered: 2005-10-11
- Posts: 71
Re: Link colours
Aha, you learn something new every day. Can I assume that the p stands for paragraph?
Offline
#11 2005-10-12 12:36:14
- Anark
- Member
- Registered: 2004-08-14
- Posts: 101
Re: Link colours
Yes, it would be pretty safe to assume that.
Hmm — but “a” for “anchor”? That sounds a bit like hypertext was originally supposed to hyper-refer you around specific points on pages rather than hyper-refer you around pages as such.
Which makes sense, come to think of it.
I’m sure it made sense in an age where a good Web page consisted of a solid 107.5 kilobyte’s worth of text and no graphics.
Offline
#12 2005-10-12 12:45:14
- Anark
- Member
- Registered: 2004-08-14
- Posts: 101
Re: Link colours
> digicammad wrote:
> does the # in front of the class name indicate the definition of an an attribute of the class?
The hash mark indicates that you’re dealing with an id rather than a class. Classes are things that will appear several times on a single page. An id appears only once per page — like a left sidebar or a right sidebar.
A declaration like:
#whatever a
says that the following selectors apply to the element a whenever it appears within the id #whatever.
Offline