Underlining links with CSS background tag

Discussions pertaining to programming of backend systems and released UNL template code.

Postby smeranda » Tue Sep 30, 2008 8:30 pm

Are you looking to get rid of the dotted line for linked images? If so, there is a class built into the templates that you can apply to the a tag:
Code: Select all
<a>
Seth Meranda
User Experience Architect
University Communications
(402) 472-8513
seth@unl.edu
smeranda
 
Posts: 111
Joined: Tue Apr 05, 2005 2:34 pm
Location: University Communications

Postby smeranda » Wed Oct 01, 2008 8:12 am

The class is .imagelink.

Your CSS doesn't work because it is trying to apply the styles to the <img> tag, not the <a> tag. In other words, the child element of the <a> tag. To my knowledge, there is not a parent selector for css (only sibling and child).

You could use Javascript, however it would probably be overkill. But if you had jQuery on your page(s), the rule would be simple:

Code: Select all
$("img").parent("a").addClass("imagelink");


Hope that helps.
Seth Meranda
User Experience Architect
University Communications
(402) 472-8513
seth@unl.edu
smeranda
 
Posts: 111
Joined: Tue Apr 05, 2005 2:34 pm
Location: University Communications


Return to Coding

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron