Hyperlink Added to ID of Same Page Link

Hi,

I have added a same page link to my site. However it has had a strange affect on ID link. The link (id="L3) now is now highlighted blue and underlined. I have tried to add a class to to it. However this only work when you mouseover it.

Can anyone advise how I can create a same page link without the ID being styled. Or to permanently style the ID link.


<a href="#L3" >Your Images</a>

<a id="L3" class="boardlink">Your Images:</a>



<div class="boardsegmentheaders">
<a id="L3" class="boardlink">Your Images:</a>
</div>


[FONT=Verdana]I’m not quite clear what you’re trying to do here. This part of your code:

 
<a href="#L3" >Your Images</a>

Creates a link to a part of your page with the id L3, but this part of your code

<a id="L3" class="boardlink">Your Images:</a>



<div class="boardsegmentheaders">
<a id="L3" class="boardlink">Your Images:</a>
</div>


contains two different sections with that same id. Apart from the fact that an id can only validly be used once per page, that’s going to create unexpected results.

As far as styling goes, you’ll need to show us your CSS and explain a little more clearly what the problem is and what you want. :)[/FONT]

Apologies, I was meant to display the CSS.

I think I have somehow set a default style on all links but Im not sure how. Is it possible to do that somehow?

.boardsegmentheaders{
   float:left;
   width:99%;
background: #F9F8F8;
padding-top: 1%;
padding-left: 1%;
padding-bottom: 1%;
margin-bottom: 1%;
margin-top: 1%;
font-color: #000;
	font-size: 80%;
   font-weight: bold;
font-family: Helvetica, sans-serif;
}

I think you want to use name and not id for the anchor (a) tag to which your link points.


<a href="#somewhere">Jump on this page to "Somewhere"</a>
...
<a name="somewhere">Text can be here</a>

[FONT=Verdana]Blue and underlined generally is the default setting for links. If you want them to display differently, you’ll need to set specific styles. If some of your links are already styled differently, then you’ll need to amend your CSS to make them all the same - if that’s what you want - but as you haven’t shown the full CSS here, I can’t be more helpful than that.

And you still need to address the issue of having the same id twice on your page.[/FONT]

Hi,

I dont have the same ID on the page twice. I pasted the code on here twice by mistake.

This is the all the code I have: I have tried the name function but that has the same affect.



<a href="#L3" >Your Images</a>

   <div class="boardsegmentheaders">
<a name="L3" class="boardlink">Your Images:</a>
</div>


a.boardlink:link {
	color: #000;
	text-decoration: none;
	}

a.boardlink:visited {
	color: #000;
	text-decoration: none;
	}

a.boardlink:hover {
	color: #000;
	text-decoration: none;
	}

[FONT=Verdana]

<a name="L3" class="boardlink">Your Images:</a>

is an anchor, not a link, so all you should need is

a.boardlink{
	color: #000;
	text-decoration: none;
	}

However, using the code that you’ve pasted here, I still get the first (link) line of text blue and underlined, and the second line black, with no underlining, which is what you would expect. Works in Firefox and Chromium. Which browser are you using?[/FONT]

Hi,

I changed it to this and now it works fine. Cheers dude.

a.boardlink{
	color: #000;
	text-decoration: none;
	}

Glad you got it sorted. :slight_smile:

[font=verdana]Sorry Thom but that’s not the 21st century way … the use of <a name=“…”> isn’t recommended any more, for a number of reasons not least of which is the potential for confusion when styling a {...}.

The best way to link to a point within a page is just to put an ID on whatever element you want to link to. So if you want the reader to jump to <div class="boardsegmentheaders"> then that’s what you give the ID - ie [color=green]<div class="boardsegmentheaders" id="L3">[/color]. You don’t need to add in any extra elements, you can just use what you’ve already got there.[/font]

name on <a tags is obsolete - it is only necessary if you have visitors using the long dead Netscape 4.

Similarly an id can go on any tag not just on an <a> so it generally works out better to not put it on an <a> tag unless you need to also support Netscape 4 - in which case you’d include both an id and a name with the same value.

Well then. I will just take my slide-rule, straighten out my [URL=“http://en.wikipedia.org/wiki/Leisure_suit”]Leisure Suit and drive my [URL=“http://en.wikipedia.org/wiki/AMC_Gremlin”]Gremlin home in embarrassment!!

Thanks for the edification. I was not aware of that change. Can I stop using the ‘blink’ tag now too???

Yes, in all cases except <blink>182</blink>.