473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

A whole div or p as link - possible?

Hi folks,

is it possible, in a way compliant to XHTML strict, to make a whole
div or a whole paragraph a link? More general, how to make a block
element a link? I mean something like:

[...]
<a href="http://subdom.dom.de/">
<p>
Test1<br />
BlaBlaBlaBlaBlaBla<br />
Test2<br />
</p>
</a>
[...]

This code works in newest Opera, IE and Mozilla, but it's not
compliant to XHTML strict. The purpose would be that the whole
rendering area (i.e. the whole (commonly rectangular) box) of the
paragraph acts as a link, and not only the text (or other contents)
within the paragraph.

What's the easiest method to achieve this in a way compliant to XHTML
strict?

Thank you very much,

Peter
Jul 20 '05 #1
2 4134
in post: <news:65*************************@posting.google.c om>
it*@omeganet.de (Peter Pfannenschmid) said:
is it possible, in a way compliant to XHTML strict, to make a whole
div or a whole paragraph a link?
a{display:block;width:100%;height:100%;}
<a href="http://subdom.dom.de/">
<p>
Test1<br />
BlaBlaBlaBlaBlaBla<br />
Test2<br />
</p>
</a>
[...]

This code works in newest Opera, IE and Mozilla, but it's not
compliant to XHTML strict.


it only works by accident, its invalid
--
brucie - i usenet nude
Jul 20 '05 #2
On 31 Jan 2004 14:21:44 -0800, it*@omeganet.de (Peter Pfannenschmid)
wrote:
is it possible, in a way compliant to XHTML strict, to make a whole
div or a whole paragraph a link?


No good reason why you shouldn't, but the DTD forbids it.

The "XHTML way" to do this, would be to embed <span> and similar
%inline; elements, then to use CSS to style them with display:block;
as if they were a <div>

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Thomas Mlynarczyk | last post by:
Hello, How can I make an <a> element (containing text only, styled to be a box with a border) as big as the table cell in which it resides, *without* having specified any width/height (neither...
4
by: Newbie | last post by:
Is it possible to set up an event handler or something else so that when *any* link on the page is clicked it 'fires-up', executes some JS and then continues to process the link that was clicked?...
6
by: SF RVN | last post by:
Hmmmm.. a wee bit of a problem: Background default.htm has a left-aligned table serving as a 'navigation menu' and a right-aligned iFrame (named 'viewframe') serving as the 'target' for...
50
by: Michael Mair | last post by:
Cheerio, I would appreciate opinions on the following: Given the task to read a _complete_ text file into a string: What is the "best" way to do it? Handling the buffer is not the problem...
9
by: Alberto | last post by:
Eh unfortunately Google groups does not provide any longer a way to reply to the group for older posts (though the one I am referring to is not older than one month), and I happen to come back to...
19
by: Martin Eyles | last post by:
Hi, I want to make a whole table a link, so that clicking anywhere on it takes you to another page. Unfortunately the way I initially thought of doing this involved invalid html. I have tried a...
3
by: mcwd | last post by:
I'm trying to put a border around a link when the mouse rolls over it. I've made an example below and left out the hover to keep it simple. In IE the example below draws a box arround the image OK,...
4
by: Abhay | last post by:
private void pd_PrintPage(object sender, PrintPageEventArgs e) { RectangleF objR = new RectangleF(); PrintDocument pd = (PrintDocument)sender; float fT, fB, fL, fR; //GET THE BEST POSSIBLE...
1
by: jonnyboy6969 | last post by:
Hi All Really hoping someone can help me out here with my deficient regex skills :) I have a function which takes a string of HTML and replaces a term (word or phrase) with a link. The pupose...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.