/    Sign up×
Community /Pin to ProfileBookmark

Disabling Anchor Tags

I have made a print version of a page. For it I am using a print style sheet and I import this stylesheet using
<link rel=”stylesheet” type=”text/css” media=”print” href=”thePagePrint.css”>
Now I want to disbale all the links on this page. In stylesheet I have changed the color of all anchor tags so that they dont appear as links but they are still clickable. Is there any way I can disable these links using CSS.

to post a comment
CSS

8 Comments(s)

Copy linkTweet thisAlerts:
@FangMar 08.2006 — What has disabling links got to do with the print style sheet?
Copy linkTweet thisAlerts:
@pcthugMar 08.2006 — There are clickable links on paper now?

maybe try:
[CODE]
a {display:none}
[/CODE]
Copy linkTweet thisAlerts:
@FangMar 08.2006 — There are clickable links on paper now?[/QUOTE]
Are you using [URL=http://www.semiconductors.philips.com/news/content/file_1054.html]electronic paper[/URL]?
Copy linkTweet thisAlerts:
@gaurav1146authorMar 08.2006 — Sorry for the confusion. By print version I meant the print preview version (for which I am using a certain style sheet). Actually I am doing this because I want to remove ads and other stuff when a user prints a page. Now what I meant was that there are clickale links on this print preview page.

For example check this page: http://en.wikipedia.org/w/index.php?title=TARDIS&printable=yes

This is a print preview of a wikipedia article. Now if u click on 'Dr Who' in the second line, it takes u to that article. What I want is to do is to disable all such links on my print preview page.
Copy linkTweet thisAlerts:
@FangMar 08.2006 — No need for a generated print page; the browser will do ths for you using the print css, then none of the links work.

If you must have the generated print page, then use the DOM to remove/change all href's
Copy linkTweet thisAlerts:
@gaurav1146authorMar 08.2006 — Thanx, for the response. I do need the generated print page because I just want the relevant part of the page to be printed leaving the ads and other stuff.


I think I would have to use Javascript now.
Copy linkTweet thisAlerts:
@Robert_WellockMar 08.2006 — Just a good CSS Print Profile would work generally. Though if you really want to do strange things then yes I see your point about the links and display: none.
Copy linkTweet thisAlerts:
@felgallMar 08.2006 — If you disappear the links in the content then the text will become unreadable. You probably only want

a {decoration:none}

to turn off the underline for regular links and just use display:none for the navigation links (just make sure they are in their own class).
×

Success!

Help @gaurav1146 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...