473,407 Members | 2,546 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,407 software developers and data experts.

Div tags as links

I would like to be able to use an entire div tag as a link to another
page; i.e. (logically) I would like to put <a
href="whatever.htm"><div>stuff</div></a>.

Now I understand that the HTML 4.01 and XHTML standards do now allow
this and, since I don't want the sky to fall on my head tomorrow,
thought I'd be able to find another way of doing it.

Only I can't. If anyone knows of a standards compliant way of
achieving this modest goal then I would be rather grateful.

Regards,

Tintax
Jul 20 '05 #1
1 3213
Tintax wrote:
I would like to be able to use an entire div tag as a link to another
page; i.e. (logically) I would like to put <a
href="whatever.htm"><div>stuff</div></a>.

Now I understand that the HTML 4.01 and XHTML standards do now allow
this and, since I don't want the sky to fall on my head tomorrow,
thought I'd be able to find another way of doing it.

Only I can't. If anyone knows of a standards compliant way of
achieving this modest goal then I would be rather grateful.


Use initially inline content formatted as block using CSS:

<a href="whatever.html" class="fancy block">
<span>stuff</span>
<span class="none"> | </span>
<span class="para">stuff</span>
stuff
</a>

..block { display: block }
..fancy { border: 2px dashed; padding: 1ex }
..fancy:hover { border-style: solid }
..para { display: block; margin: 1em 0 }
..none { display: none }

Use some content to separate the inline parts. In this case I've used:

<span class="none"> | </span>

which is taken out from the visual layout when the stylesheet is in
effect.

--
Stanimir

Jul 20 '05 #2

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

Similar topics

5
by: Markus Ernst | last post by:
Hello I have a regex problem, spent about 7 hours on this now, but I don't find the answer in the manual and googling, though I think this must have been discussed before. I try to simply...
5
by: Donald Firesmith | last post by:
Are html tags allowed within meta tags? Specifically, if I have html tags within a <definition> tag within XML, can I use the definition as the content within the <meta content="description> tag? ...
12
by: Stefan Weiss | last post by:
Hi. (this is somewhat similar to yesterday's thread about empty links) I noticed that Tidy issues warnings whenever it encounters empty tags, and strips those tags if cleanup was requested....
6
by: snacktime | last post by:
I've searched and searched and have not found a solution to suppress the margin on form or href tags so that there is no space before or after the tag. The only way I have found to do this is to...
3
by: hapaboy2059 | last post by:
Hello, I need help in using sgmlparser to parse a html file and keep track of the number of times each tag is being used. In the end of this program I need to print out the number of times...
1
by: Max Power | last post by:
HTML reprocessor: how do you get rid of the obese MS-Word (normal or filtered) HTML? I just want all the fancy MS tags removed and replaced with basic ones, or if applicable -- stripped entirely...
5
by: Bubba | last post by:
I need to use an inline css tag for a few links that will not behave like the a:link and a:hover attributes in my stylesheet. I want to add a special link color with underline and a mouseover...
2
by: thetechturf.com | last post by:
I have some simple dynamic content pages (included below). I need to know how to add specific meta tags (ie. description, keywords, ect.), as well as extra specific header coding to a page. I would...
21
by: karen987 | last post by:
I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The...
0
by: Formula | last post by:
Hello everybody,because I am newbie in python two weeks only but I had programming in another languages but the python take my heart there's 3 kind of arrays Wow now I hate JAVA :) . I am working...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.