|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
problem with css format for hyperlinkI 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> | <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; } Add this to your CSS:
..downloadHeading a {text-decoration: none;} ..downloadHeading a:hover {font-weight: normal;} -- Show quoteHide quoteRon 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 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> > | <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; > } 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 But that seemed quite clumbsy - particularly if I had more links thatclass="downloadHeading" href="www.xyz.com">DOWNLOAD</a> I wanted to apply the same style to. Thanks again. Andrew No replace your
..downloadHeading:hover { font-weight:bold; } With ..downloadHeading a {text-decoration: none;} ..downloadHeading a:hover {font-weight: normal;} -- Show quoteHide quote_____________________________________________ SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] "Warning - Using the F1 Key will not break anything!" (-; _____________________________________________ <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 | 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>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>-- Show quoteHide quoteRon 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 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>
Other interesting topics
FrontPage 2002 crashes when embedding a Google Map
Re: Using HTML To Download File IF in Hyperlink Tracking Logins and Searches Hyperlink Is FrontPage Where To begin? Two questoins, behaviors and pages how do I pasword protect the first page to a website in Frtpge 200 Table - Adding Item To Text Box Protect forms page from unwanted entries |
|||||||||||||||||||||||