Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-22-2012, 03:41 PM   PM User | #1
redstep
New to the CF scene

 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
redstep is an unknown quantity at this point
Two types of links in a single template (Joomla!)

Hello Everyone,

I am trying to modify the Atomic template of Joomla. So what I want is to have the links of article/blog titles to have a black text with yellow background, while the rest of the links are just plain black.

All the links in my template uses the parameter below:

a:focus, a:hover {color:#fff;text-decoration:none;}
a {color:#121212;text-decoration:none;background-color:#ffc21f;


The problem with this code is that it makes every link in the page to have a yellow background.

Normally, I'll just make a separate class for the blog title and insert that into the <a> tags like <a class="blog-link"...></a>, but sadly the codes for the titles are generated by Joomla and I can't seem to find them. In addition, it kind of defeat the purpose of using a content management system like Joomla if I were to manually code the <a> tags every time a blog is published.

So, what do you recommend I do?
redstep is offline   Reply With Quote
Old 12-22-2012, 04:05 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello redstep,
Would using the id or class of the element that contains your link be specific enough? If all the links will be contained in <article> you may target only those links by writing your CSS like this -
Code:
article a:focus, article a:hover {color:#fff;text-decoration:none;}
article a {color:#121212;text-decoration:none;background-color:#ffc21f;
See about specificity here.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

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

Forum Jump


All times are GMT +1. The time now is 07:52 AM.


Advertisement
Log in to turn off these ads.