/    Sign up×
Community /Pin to ProfileBookmark

make a link from blank space

Hey guys,

I’m wanting to make a link with nothing in it. So normally you would have some text, or an image.. I want neither – just a blank ‘container’. I’ve tried using an invisable image but you can highlight/select it which looks terrible. I have also tried:

[code=html]<a href=”mylink.html”><div width=”50px” height=”50px”></div></a>[/code]

But this doesn’t work.
I also looked into objects and stuff but I want something cross browser friendly..

Any suggestions would be much appreciated,

Thanks,

bob

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@donatelloFeb 25.2011 — Create an image which is a clear pixel.

Then size it. Then create a class which has no highlighting for the image.

So you can do something like this.

[code=html]<a href="http://www.google.com"><a href="clearpixel.gif" width="50" height="50" border="0"></a>[/code]

If you need to create a style, then put it in a DIV.

[code=html]<style>
#invisilink a:hover {
text-decoration:none; }
#invisilink img {border:0;}
</style>

<div id="invisilink">
<a href="http://www.google.com"><a href="clearpixel.gif" width="50" height="50" border="0"></a>
</div>[/code]
Copy linkTweet thisAlerts:
@lilfellabobauthorFeb 25.2011 — thanks for the reply, but the image can still be highlighted..

in my style sheet i have this:
[CODE]
#invis_link a:hover
{
text-decoration:none;
}

#invis_link img
{
border:0;
}
[/CODE]

then in my html I have:
[CODE]
<div id="invis_link">
<a href="http://not111.com"><img src="blank.png" width="120px" height="40px"></a>
</div>
[/CODE]

and if I control A I can still see a highlighted area... it annoys me :
Copy linkTweet thisAlerts:
@Eye_for_VideoFeb 25.2011 — Well this is sort of an unusual request...

My guess is that no one else in the whole world will really care if you can "highlight/select" it or "control A" and see a highlighted area...

That being said. and in light of a good solution already being mentioned...

How about just an image map over the <div>, give it a width/height and background color to match page. give the map a url...

or use Flash, a simple .swf the size and color that fits the container and color to match the page color, then use a getURL or nav to URL inside the .swf..

Best of luck on this one,

Eye for Video

www.cidigitalmedia.com
×

Success!

Help @lilfellabob 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...