HighDots Forums  

css for anchor tag without href

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss css for anchor tag without href in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andy
 
Posts: n/a

Default css for anchor tag without href - 09-28-2009 , 05:05 PM






Hi,

I have a document with lots of <a> tags that wrap phrases to make them
anchors only (no href attribute). When I display the document, they
do not have underline or color in the browser. Is there a way to
style these tags with css?

Andy

Reply With Quote
  #2  
Old   
dorayme
 
Posts: n/a

Default Re: css for anchor tag without href - 09-28-2009 , 05:23 PM






In article
<4b058073-dafb-4a1a-a610-74d273f94efc (AT) z24g2000yqb (DOT) googlegroups.com>,
Andy <p7eregex (AT) gmail (DOT) com> wrote:

Quote:
I have a document with lots of <a> tags that wrap phrases to make them
anchors only (no href attribute). When I display the document, they
do not have underline or color in the browser. Is there a way to
style these tags with css?

a {text-decoration: underline; color: red; background: white;}
a:link {text-decoration: none; color: blue; background: white;}

<a name="here">here</a><br>
<a href="example.com">example.com</a>

--
dorayme

Reply With Quote
  #3  
Old   
John Hosking
 
Posts: n/a

Default Re: css for anchor tag without href - 09-29-2009 , 03:22 AM



On Tue, 29 Sep 2009 07:23:51 +1000, dorayme wrote:

Quote:
In article
4b058073-dafb-4a1a-a610-74d273f94efc...oglegroups.com>,
Andy <p7eregex (AT) gmail (DOT) com> wrote:

I have a document with lots of <a> tags that wrap phrases to make them
anchors only (no href attribute). When I display the document, they
do not have underline or color in the browser. Is there a way to
style these tags with css?


a {text-decoration: underline; color: red; background: white;}
a:link {text-decoration: none; color: blue; background: white;}

a name="here">here</a><br
a href="example.com">example.com</a
Yes, but wait a minute: Is the OP really trying to make non-links look like
links (just because he used an <a> element)? Or am I just too tired to
think clearly?

The code example above makes the real links look like blue regular text,
and the non-link anchors look like red links. I think I won't want to visit
that page.

Or maybe I'm just tired.

--
John
Andy probably doesn't want me to visit anyway.

Reply With Quote
  #4  
Old   
Andy Dingley
 
Posts: n/a

Default Re: css for anchor tag without href - 09-29-2009 , 04:46 AM



On 28 Sep, 22:23, dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote:

Quote:
a name="here">here</a
Or even
<a id="here">here</a>

There seems little reason to preserve use of the name attribute here,
even in <a>

Reply With Quote
  #5  
Old   
Adrienne Boswell
 
Posts: n/a

Default Re: css for anchor tag without href - 09-29-2009 , 01:37 PM



Gazing into my crystal ball I observed John Hosking
<john-nin2 (AT) bluemail (DOT) ch> writing in
news:7idqv8F30nk17U1 (AT) mid (DOT) individual.net:

Quote:
On Tue, 29 Sep 2009 07:23:51 +1000, dorayme wrote:

In article
4b058073-dafb-4a1a-a610-74d273f94efc...oglegroups.com>,
Andy <p7eregex (AT) gmail (DOT) com> wrote:

I have a document with lots of <a> tags that wrap phrases to make
them anchors only (no href attribute). When I display the document,
they do not have underline or color in the browser. Is there a way
to style these tags with css?


a {text-decoration: underline; color: red; background: white;}
a:link {text-decoration: none; color: blue; background: white;}

a name="here">here</a><br
a href="example.com">example.com</a

Yes, but wait a minute: Is the OP really trying to make non-links look
like links (just because he used an <a> element)? Or am I just too
tired to think clearly?

The code example above makes the real links look like blue regular
text, and the non-link anchors look like red links. I think I won't
want to visit that page.

Or maybe I'm just tired.

I can see where that might be kind of useful. If you wanted to
distinguish between internal and external links, and provide a
"bookmark" so a user could clearly tell where an internal link goes.

Here's a sample:
http://www.cavalcade-of-coding.info/usenet/anchors.html

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Reply With Quote
  #6  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: css for anchor tag without href - 09-29-2009 , 03:19 PM



Adrienne Boswell wrote:

Quote:
I can see where that might be kind of useful. If you wanted to
distinguish between internal and external links, and provide a
"bookmark" so a user could clearly tell where an internal link goes.

Here's a sample:
http://www.cavalcade-of-coding.info/usenet/anchors.html
Internal vs. external links is really a different issue (and awkward, since
there's really no other working way to distinguish between them except via
classes).

Indicating "bookmarks" would be useful, but doing it statically with a[name]
(and/or a[id] or *[id]) isn't particularly useful. Little does it help to
see all the possible destinations for links, when the user would really need
to isolate the particular destination he just jumped to. But there's no such
way in CSS.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Reply With Quote
  #7  
Old   
Adrienne Boswell
 
Posts: n/a

Default Re: css for anchor tag without href - 09-29-2009 , 04:28 PM



Gazing into my crystal ball I observed "Jukka K. Korpela"
<jkorpela (AT) cs (DOT) tut.fi> writing in
news:F5twm.22409$La7.141 (AT) uutiset (DOT) elisa.fi:

Quote:
Adrienne Boswell wrote:

I can see where that might be kind of useful. If you wanted to
distinguish between internal and external links, and provide a
"bookmark" so a user could clearly tell where an internal link goes.

Here's a sample:
http://www.cavalcade-of-coding.info/usenet/anchors.html

Internal vs. external links is really a different issue (and awkward,
since there's really no other working way to distinguish between them
except via classes).

Indicating "bookmarks" would be useful, but doing it statically with
a[name] (and/or a[id] or *[id]) isn't particularly useful. Little does
it help to see all the possible destinations for links, when the user
would really need to isolate the particular destination he just jumped
to. But there's no such way in CSS.

I agree with you, but it would be kind of nice to see "bookmarks".
Opera has a a scrolling thingy, but it doesn't work the way it should.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Reply With Quote
  #8  
Old   
Osmo Saarikumpu
 
Posts: n/a

Default Re: css for anchor tag without href - 09-30-2009 , 05:01 AM



Adrienne Boswell kirjoitti:

Quote:
I agree with you, but it would be kind of nice to see "bookmarks".
Opera has a a scrolling thingy, but it doesn't work the way it should.
[OT]

I use an bookmarklet for that, mainly to facilitate linking to anchors
in my own pages. I think I modified mine from:

https://www.squarefree.com/bookmarklets/webdevel.html#named_anchors

--
Best wishes,
Osmo

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.