|
Posted by BootNic on 12/10/06 15:45
> David Smithz <dave1900@blueyonder.co.uk> wrote:
> news: q_Jeh.14235$k74.11144@text.news.blueyonder.co.uk
> Hi there,
>
> I have a 1row * 1 column table containing a text which acts as a
> hyperlink.
>
> My aim is to have the text positioned in the cell but the visitor to
> be able to click anywhere within the cell to be able follow the
> hyperlink. (Not just the actual text itself and without relying on
> JavaScript).
>
> I'm using the following code:
[snip]
> I have tried a few things (e.g. such as putting the anchor (<A>)
> around the table rather then the text in the table but it does not
> work properly when I do this.
>
> Any suggestions on how to achieve this?
>
> (I will also be adding the effect (via JavaScript) that when the
> mouse is moved into the cell the entire background colour changes - I
> can achieve this but no point having it if you cannot actually follow
> the URL until moving over the text).
No need for Javascript
> Thanks in advance.
To treat a link as a block element, just declare it with CSS.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
<style type="text/css">
a.blocka, a.blocka:link {
background-color: rgb(255, 255, 224);
color: rgb(0, 128, 0);
display: block;
margin: auto;
padding: 0.3em;
text-decoration: none;
width: 10em;
}
a.blocka:visited {
background-color: rgb(15, 0, 15);
color: rgb(240, 255, 240);
}
a.blocka:hover {
background-color: rgb(173, 216, 230);
color: rgb(255, 0, 0);
text-decoration: underline;
}
a.blocka:active,
a.blocka:focus {
background-color: rgb(255, 90, 0);
color: rgb(255, 215, 0);
}
</style>
</head>
<body>
<div>
<a class="blocka" href="./index2.php">Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Donec nibh. Integer velit ligula,
faucibus eu, consequat non, molestie nec, orci. Vestibulum
varius, dui sit amet.</a>
</div>
</body>
</html>
--
BootNic Sunday, December 10, 2006 10:44 AM
"This seems like a case where we need to shoot the messenger."
*Charlie Kaufman on Cypherpunks list*
Navigation:
[Reply to this message]
|