SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot sularome's Avatar
    Join Date
    Jan 2006
    Location
    Poland
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Responsive images not respecting width inside table-cell

    Hi guys,

    Here is an example page that works correctly inside chrome but not in firefox or IE9 : http://yordanstoev.com/test/test_123.html
    The problem is that the image is not resized to the correct width for the cell and the cell is stretched not respecting the set width of 50%.

    Setting image width:100%; solves the problem, but smaller images will stretch to full width.

    Thanks for the help.

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,478
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    If you want cells to obey the widths properly then you need the table-layout:fixed algorithm.

    e.g.
    Code:
    <div style="width:50%;margin:0 auto;backgorund:green;display:table;table-layout:fixed">
    	<div style="display:table-row;">
    
    etc...................


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •