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 7089031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:52:22+00:00 2026-05-28T07:52:22+00:00

why does html elements have the max-height attribute if they are not going to

  • 0

why does html elements have the max-height attribute if they are not going to follow it. For example I have the table:

<table  border="2" style="table-layout:fixed; max-height:20px;">
    <tr style="height:20px;">
        <td style="overflow:hidden; max-height:20px; overflow:hidden;">
            <img id="book" src="img/capture.png" alt="" style="position:relative; margin-top:0px;" />
        </td>
    </tr>
</table>

and if the img happens to have a height greater than 20px the table row’s height will not equal 20px. How can I tell html that I want the table row to have a height of 20px?

Edit:

I know I can change the img height but I don’t want to distort the img.

  • 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-05-28T07:52:23+00:00Added an answer on May 28, 2026 at 7:52 am

    This likely has to do with the fact that td isn’t display:block, but actually display:table-cell. I don’t think display table-cell supports max-height.

    Is there a reason you don’t want to set the height on the <img> tag?

    See also: Setting max-height for table cell contents

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

Sidebar

Related Questions

Does Django have any template tags to generate common HTML markup? For example, I
Does the HTML select element have an on select event? what exactly is the
Ryan Bates' nifty_scaffolding, for example, does this edit.html.erb <%= render :partial => 'form' %>
I have an html table and one column (or <td> ) contains very long
I have a page with deeply-nested HTML elements generated from a framework. I would
I have to encode strings to remove parentheses for Ids for HTML elements. Parentheses
We have JS API does many things based on the HTML (markup semantics and
I have seen people apply the CSS property zoom: 1; on HTML elements. Why
Most of the experience I have manipulating HTML elements using Javascript involves the innerHTML
I have custom Question objects which I render into html form elements. I want

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.