Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > hyperlink a positioned image?

Reply
Thread Tools

hyperlink a positioned image?

 
 
abby
Guest
Posts: n/a
 
      03-01-2005
Please help,
Using CSS how can I position an image center/center on a page AND
hyperlink the image??
The following markup does not appear to allow for a hyperlink
<style type="text/css">
body
{
background-image:
url('smiley.gif');
background-repeat:
no-repeat;
background-position:
center;
}
</style>

Thank you!

(posted also in alt.html.critique)

 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      03-01-2005
"abby" <(E-Mail Removed)> wrote:

>Using CSS how can I position an image center/center on a page AND
>hyperlink the image??


img.foo {psoition: absolute; top: 50%; left: 50%; margin-top -100px;
margin-left: -100px;}

<a href="bar.html"><ing class="foo" src="foo.gif" alt="Foo Bar"
width="200" height="200"></a>

Change the margin-top and margin-height values to half the dimensions
of your image.

If you have other content on the page then that content may
over/underlap the image, possibly making it unclickable.

>The following markup does not appear to allow for a hyperlink
><style type="text/css">
>body
>{
>background-image:
>url('smiley.gif');
>background-repeat:
>no-repeat;
>background-position:
> center;
>}
></style>


A background-image is decoration. It serves no functional purpose
(though obviously it serves a decorative purpose with all the
implications for user experience that implies). If an image is to be a
link then it has a functional purpose then it must not be a background
image.

>(posted also in alt.html.critique)


Please don't multi-post. If you must, cross-post and pick one group
for followups. This response cross-posted and followups set to
alt.html.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
 
abby
Guest
Posts: n/a
 
      03-01-2005
Steve Pugh wrote:
> "abby" <(E-Mail Removed)> wrote:
>
> >Using CSS how can I position an image center/center on a page AND
> >hyperlink the image??

>
> img.foo {psoition: absolute; top: 50%; left: 50%; margin-top -100px;
> margin-left: -100px;}
>
> <a href="bar.html"><ing class="foo" src="foo.gif" alt="Foo Bar"
> width="200" height="200"></a>
>
> Change the margin-top and margin-height values to half the dimensions
> of your image.
>
> If you have other content on the page then that content may
> over/underlap the image, possibly making it unclickable.
>
> >The following markup does not appear to allow for a hyperlink
> ><style type="text/css">
> >body
> >{
> >background-image:
> >url('smiley.gif');
> >background-repeat:
> >no-repeat;
> >background-position:
> > center;
> >}
> ></style>

>
> A background-image is decoration. It serves no functional purpose
> (though obviously it serves a decorative purpose with all the
> implications for user experience that implies). If an image is to be

a
> link then it has a functional purpose then it must not be a

background
> image.
>
> >(posted also in alt.html.critique)

>
> Please don't multi-post. If you must, cross-post and pick one group
> for followups. This response cross-posted and followups set to
> alt.html.
>
> Steve
>
> --
> "My theories appal you, my heresies outrage you,
> I never answer letters and you don't like my tie." - The Doctor
>
> Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>



Thanks a million Steve
....that worked fine (once I changed spelling for "psoition" and "ing
class" and also added a ":" to "margin-top"
I used your markup at http://www.cregg-house.com (yeah, they insisted
on a splash page image)

--
Abby

 
Reply With Quote
 
abby
Guest
Posts: n/a
 
      03-01-2005
Thanks a million Steve
....that worked fine (once I changed spelling for "psoition" and "ing
class" and also added a ":" to "margin-top"
I used your markup at http://www.cregg-house.com (yeah, they insisted
on a splash page image)

--
Abby
ps/ sorry about the multi-post!

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Positioning of "non-positioned controls" (datasource etc) =?Utf-8?B?TWFya3VzIFJ5dHRlcmt1bGw=?= ASP .Net 0 03-15-2006 08:04 AM
vertically align absolutely positioned div elements Guybrush Threepwood HTML 1 12-14-2005 09:29 PM
Help with links within relatively positioned table Fat, Dumb and Happy HTML 2 03-01-2005 03:36 PM
flow content following absolutely-positioned panel John A Grandy ASP .Net 3 06-15-2004 12:04 PM



Advertisments