PC Review


Reply
Thread Tools Rate Thread

CSS File to Modify

 
 
JCO
Guest
Posts: n/a
 
      28th Apr 2004
Is there a way to distinguish between links (w/hover) to another page versus
an internal BookMark (that I would like to be different?



 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      28th Apr 2004
The only way to do this would be to create classes, and assign the
appropriate class to internal and external links.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

" JCO" <(E-Mail Removed)> wrote in message
news:0FRjc.100483$(E-Mail Removed)...
> Is there a way to distinguish between links (w/hover) to another page

versus
> an internal BookMark (that I would like to be different?
>
>
>



 
Reply With Quote
 
Jack Brewster
Guest
Posts: n/a
 
      28th Apr 2004
Because both types of links are exactly the same, they will react to common
CSS declarations the same way.

<a href="http://www.example.com">External Link</a>
<a href="#bookmark1">Bookmark Link</a>

There's no way to automagically use CSS to style them differently. (Let me
qualify that by saying there may be a way in the newest CSS spec, but it
won't be supported very well.)

You're going to have to create a new class and apply it to one of the link
types. So, assume you want to style the bookmark links you could create a
more specific style for bookmarks and then apply that to any bookmark link.
For example:

<html>
<head>
<style type="text/css">
a:link { color: #008000; }
a:link.bookmark { color: #f00; }
</style>
</head>
<body>
<p><a href="http://www.example.com">External Link</a></p>

<p><a href="#bookmark1" class="bookmark">Bookmark Link</a></p>
</body>
</html>

Note that you _need_ to combine the a:link.bookmark for it to apply to link
text.

--
Jack Brewster - Microsoft FrontPage MVP


" JCO" <(E-Mail Removed)> wrote in message
news:0FRjc.100483$(E-Mail Removed)...
> Is there a way to distinguish between links (w/hover) to another page

versus
> an internal BookMark (that I would like to be different?
>
>
>



 
Reply With Quote
 
Jon Spivey
Guest
Posts: n/a
 
      28th Apr 2004
Hi,
CSS isnt that smart - javascript could be. If you had 2 classes such as
a.internal{
color:red;
}
a.external{
color:green;
}
you could do something like
<script type="text/javascript">
function setLinks(){
var a = document.getElementsByTagName("A")
for(i=0;i<a.length;i++){
a[i].className=(a[i].indexOf(location.href)>-1)?"internal":"external";
}}
</script>
<body onload="setLinks()">

This will loop all the links and set boomarks to internal class and others
to external

--
Cheers,
Jon
Microsoft MVP - FP

JCO wrote:
> Is there a way to distinguish between links (w/hover) to another page
> versus an internal BookMark (that I would like to be different?



 
Reply With Quote
 
Wally S
Guest
Posts: n/a
 
      29th Apr 2004
If you don't mind formatting each link individually, you just select the
link and assign a class to it. It may a be a bit time-consuming, but you
will get the results you want, and it will be easier and faster than using
javascript.

Wally S

" JCO" <(E-Mail Removed)> wrote in message
news:0FRjc.100483$(E-Mail Removed)...
> Is there a way to distinguish between links (w/hover) to another page

versus
> an internal BookMark (that I would like to be different?
>
>
>



 
Reply With Quote
 
JCO
Guest
Posts: n/a
 
      29th Apr 2004
Thanks everybody for your response.
It dosen't appear that it is in the best interest to waste much time on
this.
Thanks again.

"Wally S" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If you don't mind formatting each link individually, you just select the
> link and assign a class to it. It may a be a bit time-consuming, but you
> will get the results you want, and it will be easier and faster than using
> javascript.
>
> Wally S
>
> " JCO" <(E-Mail Removed)> wrote in message
> news:0FRjc.100483$(E-Mail Removed)...
> > Is there a way to distinguish between links (w/hover) to another page

> versus
> > an internal BookMark (that I would like to be different?
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify The Code For Importing Text File into an Excel File vicky Microsoft Excel Programming 2 29th Dec 2009 08:13 AM
RE: How to modify the EXE file using VB.NET Nigel V Thomas Microsoft VB .NET 0 4th Oct 2009 01:15 PM
modify a XML file Maileen Microsoft VB .NET 2 4th Dec 2004 01:27 PM
modify exe file =?Utf-8?B?c2F2YWdl?= Microsoft Dot NET 1 6th Nov 2004 04:39 PM
file modify creation access time are not displayed in file search harryleone Microsoft Access Security 1 24th Jun 2004 02:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:05 AM.