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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:48:21+00:00 2026-06-10T00:48:21+00:00

I have the following code where the image is higher than 44px: <div style=width:300px;display:-ms-grid;-ms-grid-rows:44px

  • 0

I have the following code where the image is higher than 44px:

<div style="width:300px;display:-ms-grid;-ms-grid-rows:44px 44px">
    <div style="-ms-grid-row:1; -ms-grid-column:1;/*-ms-grid-row-align: start;*/">
        <img style="max-width:100%;max-height:100%" src="/picture000.png"/> </div>
    <div style="-ms-grid-row:2; -ms-grid-column:1">hola mundo</div>
</div>

this shows the image re-sized to the div keeping its aspect (what i expect), but, if you uncomment the ms-grid-row-align property and set its value to start (its default value according to http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh466348.aspx) the image is shown full size.

Is that a bug or should I be using that property with another I’m not aware of?

p.s: I asked this same question on the MSDN Metro Style apps with absolutely no answers

  • 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-10T00:48:23+00:00Added an answer on June 10, 2026 at 12:48 am

    First of all: the initial value is “stretch” and not “start”; that’s a doc bug. Setting it to “start” is actually changing the value from “stretch.”

    This is actually not a bug. The behavior you’re seeing is because when the image’s percentage-based max-height is being determined, the parent’s (the grid item’s) height is not yet defined. The result is that it is treated as “max-height: auto”, which results in the large image.

    This also explains why you get the smaller image when the grid item’s -ms-grid-row-align value is set to “stretch”. When set to “stretch”, the grid item’s height is set to the height of the row (44px in this case), and the image’s percentage-based max-height can be resolved against that value.

    You can see the same behavior without the use of the Grid:

    <div style="max-height:100px;"><img id="img" style="max-height:100%" src="/picture000.png"/></div>
    

    While your description doesn’t fully explain why you’re trying to do, you might want to consider making the image itself a grid item which will allow its percentage max-height value to resolve against the grid row itself. Note that you will want to add “-ms-grid-column-align: start” as well to ensure it doesn’t stretch and become non-proportional:

    <div style="width:300px;display:-ms-grid;-ms-grid-rows:44px 44px">
        <img style="max-width:100%;max-height:100%;-ms-grid-row:1;-ms-grid-column:1;-ms-grid-row-align: start;-ms-grid-column-align: start;" src="/picture000.png"/>
        <div style="-ms-grid-row:2; -ms-grid-column:1">hola mundo</div>
    </div>
    

    Disclosure: I am on the team that worked on Microsoft’s implementation of the CSS Grid.

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

Sidebar

Related Questions

I have following code <div class=img> <img src=image/1.jpg class=img_s style=display:none; /> <img src=image/2.jpg class=img_s
I have the following code a.rollover { background-image: url('sprite.jpg'); display: block; width: 191px; height:
Have the following code: image = new Image(display, imageData); offScreenImageGC.drawImage(image, 0, 0, imageData.width, imageData.height,
I have the following code to display an image in imagebox using EmgucV: Capture
i have following code <div class=caption style= position:absolute; margin-top:0px> <img src=caption/img1.png /> </div> <script>
I have the following code <span style=background-image:url('/product_images/attribute_value_images/78.thumbnail.jpg') class=thumbnail>&nbsp;</span> I need to change the word
I have the following code: Image tmpimg = null; HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url); HttpWebResponse
I have following code for loading image from url in xml parsing endElement method
I have the following code that simply moves my image across the screen: /*
I have the following code to download an image: imageRequest = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:magazineItem.contentURL]];

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.