The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Being selective with Hyperlink Cues
bek1
post Apr 9 2012, 12:56 PM
Post #1


Unregistered









Hello.

I have code in my CSS file that looks like this:

CODE

a[href$='.pdf'] {
    background:transparent url(../img/icons/page_white_acrobat.png) center left no-repeat;
    display:inline-block;
    padding-left:20px;
    line-height:15px; }


It works great. My problem is that I need to have some links not show the image cue. I'm actually a desktop developer, so it's all pretty new to me. Does anyone know how I can use this with *some* PDF links, but not others?

This post has been edited by bek1: Apr 9 2012, 01:16 PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Darin McGrew
post Apr 9 2012, 03:42 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Please see the FAQ entry Where can I learn about CSS?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
bek1
post Apr 9 2012, 04:30 PM
Post #3


Unregistered









QUOTE(Darin McGrew @ Apr 9 2012, 04:42 PM) *

Please see the FAQ entry Where can I learn about CSS?


Thanks, Darin. There is certainly a LOT to learn about CSS. Unfortunately for me as a desktop developer, time is a limiting factor. I have to jump in, learn enough in my free time to get by and get the job done, then get back to what pays the bills. However, Pandy was incredibly helpful above and I very much appreciate it.
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 9 2012, 04:38 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



In your second example there is no link text for the PDF link, nothing to click on. Furthermore you've nested links. You can't do that. The "outer" link also contains a P. Can't do that either. A can't contain block level elements.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
bek1
post Apr 10 2012, 08:40 AM
Post #5


Unregistered









QUOTE(pandy @ Apr 9 2012, 05:38 PM) *

In your second example there is no link text for the PDF link, nothing to click on. Furthermore you've nested links. You can't do that. The "outer" link also contains a P. Can't do that either. A can't contain block level elements.


Ahhh... I have a lot to learn. Thank you for the heads up.
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 10 2012, 09:12 AM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



See the links at the top and bottom of the pages here? The validator tells you what I told you, well, not about the lacking linktext, but about the nesting and that you Peed in your link. tongue.gif
The HTML reference has some handy information about what other elements an element can contain at the top of the page for each element. For example for A you can read: "Contents: inline elements except A". Sort of says it all. In the validator result you'll find clickable links to the related spots in the reference. So using the validator isn't only a way to find your errors, it's also an easy way to learn the basics without having to read the reference or the w3c spec from top to bottom.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
bek1
post Apr 10 2012, 11:30 AM
Post #7


Unregistered









Hi, Pandy.

I hate to bother you again--I know you're a busy person like everyone--but I have been struggling with this for the 3 hours since I posted my last response. I cleaned up the problems you mentioned, but am back to my original problem of having the cue show up. Can you help me one more time?

This is the code I currently have:

CODE

<a class="thumbnail" href="references/ricksmith.pdf">
    <img src="img/letter115x165.jpg" width="115" height="165" border="0" />
    <span>
        <img src="img/tree.jpg" />Letter of Reference from Rick Smith, current Branch Manager.
    </span>

    <br>Rick Smith<br>Branch Manager<br>at Labor                            <!-- Text under picture -->

</a>


I have tried adding a second class (plainlink) like this:

CODE
<a class="thumbnail plainlink" href="references/ricksmith.pdf">


But it has no effect. I have also tried adding this code to my thumbnail class:

CODE
a[href$='.pdf'] { ... }



But that also has no effect. I think I am making it more complicated than it is. Do you have any ideas how to remove the cue just for this example?

This post has been edited by bek1: Apr 10 2012, 11:32 AM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 06:20 AM