Home All Groups Group Topic Archive Search About

problem with css format for hyperlink

Author
21 Apr 2009 8:00 PM
hooksie2

Is anyone able to tell me what is wrong with the following html.  When
I hover over the link the text goes bold on both.  Also they both show
up with an underline despite text-decoration: none;  Maybe there is
just a better syntax for this - if so please let me know as I'm just
learning html.

Thanks alot,
Andrew

<p class="downloadHeading"><a href="www.xyz.com">SCREENSHOT</a>
&nbsp;&nbsp;|&nbsp;&nbsp; <a href="www.xyz.com">DOWNLOAD</a></p>

My .css file has:
..downloadHeading {
    font-size: 9px;
    font-family: Arial Narrow;
    text-decoration: none;
    color: #17375E;
    margin-bottom: 0px;
    margin-top:5px;
}
..downloadHeading:hover {
    font-weight:bold;
}

Author
21 Apr 2009 8:36 PM
Ronx
Add this to your CSS:

..downloadHeading a {text-decoration: none;}
..downloadHeading a:hover {font-weight: normal;}

--
Ron Symonds - Microsoft MVP (Expression)
Reply only to group - emails will be deleted unread.
http://www.rxs-enterprises.org/fp

<hooks***@hotmail.com> wrote in message
Show quoteHide quote
news:d01aed7c-a2a9-4318-af30-832668657d68@m19g2000yqk.googlegroups.com...
> Is anyone able to tell me what is wrong with the following html.  When
> I hover over the link the text goes bold on both.  Also they both show
> up with an underline despite text-decoration: none;  Maybe there is
> just a better syntax for this - if so please let me know as I'm just
> learning html.
>
> Thanks alot,
> Andrew
>
> <p class="downloadHeading"><a href="www.xyz.com">SCREENSHOT</a>
> &nbsp;&nbsp;|&nbsp;&nbsp; <a href="www.xyz.com">DOWNLOAD</a></p>
>
> My .css file has:
> .downloadHeading {
> font-size: 9px;
> font-family: Arial Narrow;
> text-decoration: none;
> color: #17375E;
> margin-bottom: 0px;
> margin-top:5px;
> }
> .downloadHeading:hover {
> font-weight:bold;
> }
Are all your drivers up to date? click for free checkup

Author
22 Apr 2009 7:55 AM
hooksie2
Thanks Ron.

I assume you mean for me to add the
..downloadHeading a {text-decoration: none;}  etc
in addition to the .downloadHeading I have already defined in my css?

Your suggestion does get rid of the underline but the two links still
seem to be acting together.  With you code .downloadHeading a:hover
{font-weight: normal;} the opposite link to the one I am hovering over
goes bold and without that line then they both go bold together.

Is this because I have put the two links within a paragraph?  Should I
be using a <div> here?  I think it worked okay when I defined them as
<a class="downloadHeading" href="www.xyz.com">SCREENSHOT</a>   |   <a
class="downloadHeading" href="www.xyz.com">DOWNLOAD</a>
But that seemed quite clumbsy - particularly if I had more links that
I wanted to apply the same style to.

Thanks again.
Andrew
Author
22 Apr 2009 8:08 AM
Stefan B Rusynko
No replace your

..downloadHeading:hover {
font-weight:bold;
}

With
..downloadHeading a {text-decoration: none;}
..downloadHeading a:hover {font-weight: normal;}


--

_____________________________________________
SBR @ ENJOY (-:              [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!"  (-;
_____________________________________________


Show quoteHide quote
<hooks***@hotmail.com> wrote in message news:2ecf8184-7370-4dff-bad8-171a19665f76@d14g2000yql.googlegroups.com...
| Thanks Ron.
|
| I assume you mean for me to add the
| .downloadHeading a {text-decoration: none;}  etc
| in addition to the .downloadHeading I have already defined in my css?
|
| Your suggestion does get rid of the underline but the two links still
| seem to be acting together.  With you code .downloadHeading a:hover
| {font-weight: normal;} the opposite link to the one I am hovering over
| goes bold and without that line then they both go bold together.
|
| Is this because I have put the two links within a paragraph?  Should I
| be using a <div> here?  I think it worked okay when I defined them as
| <a class="downloadHeading" href="www.xyz.com">SCREENSHOT</a>   |   <a
| class="downloadHeading" href="www.xyz.com">DOWNLOAD</a>
| But that seemed quite clumbsy - particularly if I had more links that
| I wanted to apply the same style to.
|
| Thanks again.
| Andrew
|
Author
23 Apr 2009 8:49 AM
hooksie2
Thanks Stefan - the links work how I want them to now.  However, oddly
a top & bottom margin appeared to be added to my paragraph - even
though I had padding and margin set to 0px in my .downloadHeading a{}
definition.  I replaced my <p></p> tags with <span> which corrected
that but I am still curious to understand why that would happen?

Also, the links sit below a heading - is it better practice to use the
<p> tag in this context (rather than span) or is it irrelevant?

Finally I found I had to define a new style for my pipe separator (|)
otherwise it turned up as default font size - presumably because it is
not a link itself.  I guess there is no way around that?

Thanks again for all the help!
Andrew

<p class="downloadHeading"><a href="www.xyz.com">SCREENSHOT</a>   |
<a href="www.xyz.com">DOWNLOAD</a></p>
Author
23 Apr 2009 1:15 PM
Ronx
If I am interpreting your requirements correctly, your CSS should be:

..downloadHeading {
                font-size: 9px;   /* px sizing causes accessibility
problems in IE */
    font-family: "Arial Narrow", Arial, Helvetica, Sans-serif; /* fonts added
for those without Arial Narrow */
    color: #17375E;
    margin-bottom: 0px;
    margin-top: 5px;
}
..downloadHeading a {
                 text-decoration: none;
}
..downloadHeading a:hover {
    font-weight: bold;
}

If the links should be colour #17375E then use:
..downloadHeading a {
                 text-decoration: none;
                 color: #17375E;
}
and change the color attribute in the downloadHeading definition above.
( this colours the | character).
You can also change the font size for the | by changing the CSS to:

..downloadHeading {
                font-size: 9px;   /* px sizing causes accessibility
problems in IE */
    font-family: "Arial Narrow", Arial, Helvetica, Sans-serif; /* fonts added
for those without Arial Narrow */
    color: #CCCCCC;
    margin-bottom: 0px;
    margin-top: 5px;
                vertical-align: middle;
}
..downloadHeading a {
                 text-decoration: none;
                 font-size: 11px;  /* 9px is extremely small */
}
..downloadHeading a:hover {
    font-weight: bold;
}


with the code:

<p class="downloadHeading"><a href="www.xyz.com">SCREENSHOT</a>   |
<a href="www.xyz.com">DOWNLOAD</a></p>
--
Ron Symonds - Microsoft MVP (Expression)
Reply only to group - emails will be deleted unread.
http://www.rxs-enterprises.org/fp

<hooks***@hotmail.com> wrote in message
Show quoteHide quote
news:df1773c0-af9e-42ea-8dee-0668357af5c2@u8g2000yqn.googlegroups.com...
> Thanks Stefan - the links work how I want them to now.  However, oddly
> a top & bottom margin appeared to be added to my paragraph - even
> though I had padding and margin set to 0px in my .downloadHeading a{}
> definition.  I replaced my <p></p> tags with <span> which corrected
> that but I am still curious to understand why that would happen?
>
> Also, the links sit below a heading - is it better practice to use the
> <p> tag in this context (rather than span) or is it irrelevant?
>
> Finally I found I had to define a new style for my pipe separator (|)
> otherwise it turned up as default font size - presumably because it is
> not a link itself.  I guess there is no way around that?
>
> Thanks again for all the help!
> Andrew
>
> <p class="downloadHeading"><a href="www.xyz.com">SCREENSHOT</a>   |
> <a href="www.xyz.com">DOWNLOAD</a></p>

Bookmark and Share