Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8158483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:36:51+00:00 2026-06-06T17:36:51+00:00

When I remove the DOCTYPE line this code works the way I want it

  • 0

When I remove the DOCTYPE line this code works the way I want it to. The “A” link fills the full cell height for the “Cell” cell when hovering over it and clicking anywhere within the cell. note: I need to use A, and not TD onclick javascript. I don’t understand why adding the DOCTYPE breaks it, or what I can do to fix it properly, and it is driving me nuts. I’m using IE9, but would like it to work in all browsers.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>X</title>
<style type="text/css">
table,td, th {border: 1px solid #000}
td a {display: block; height:100%; width:100%;}
td a:hover {background-color: yellow;}
</style>
</head>
<body>
<table>
<tr>
 <td>
    <a href="http://www.google.com/">Cell</a>
  </td>
  <td>
    <a href="http://www.google.com/"><img alt="x" src="http://www.google.com/intl/en_ALL/images/srpr/logo1w.png"></a>
  </td>
</tr>
</table>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:36:54+00:00Added an answer on June 6, 2026 at 5:36 pm

    Since the height of the <td> is not defined (it’s determined at layout), the height: 100%; of its children are ignored.

    Set the height and line-height of the <td>:

    td { height: 100px; line-height: 100px; }
    

    Demo: http://jsfiddle.net/ThinkingStiff/twVar/

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
        <title>X</title>
        <style type="text/css">
            table,td, th {border: 1px solid #000}
            td a {display: block; height:100%; width:100%;}
            td a:hover {background-color: yellow;}
            td { height: 100px; line-height: 100px; }
            img { display: block; }
        </style>
    </head>
    <body>
    <table>
        <tr>
        <td>
            <a href="http://www.google.com/">Cell</a>
        </td>
        <td>
            <a href="http://www.google.com/"><img alt="x" src="http://www.google.com/intl/en_ALL/images/srpr/logo1w.png"></a>
        </td>
        </tr>
    </table>
    </body>
    </html>
    

    ​

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This CSS problem is killing me :-( I cannot remove padding under a link
I want a nested table to expand to the height of the enclosing cell.
NB: I tidied up this question in 2021 to remove a dead link and
Been writing web apps for years and this line: <!DOCTYPE html PUBLIC \-//W3C//DTD XHTML
Remove first comma on each line in a file. I presume sed is needed.
remove() method without any argument removes all documents inside the collection. $this->db->$collection->remove(); But how
I want to remove a specific context menu item, appears when the Mouse down(right)
I have a file frequencies.xml which contains lines with this form: <?xml version=1.0?> <!DOCTYPE
I have created an XML file using streamWriter.. Now, i want to remove the
I am trying to remove unnecessary content from HTML. Specifically I want to remove

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.