html - Responsive design: complicated display table for showing photo and content in single row -


i've asked question before (sort of), , answer wasn't able me i'm trying do. after working on website more, , countless hours trying figure out solution (i'm not entirely sure can done), i'm trying figure out. it's centerpiece home page, it's kind of important works way want, visually.

the problem:
have 2 "modules" (displayed table cells) in container (displayed table). have created jsfiddle way show how model interact landscape image , portrait image. i'll go ahead , list requirements.

  • the content container should have minimum width of 30% - 30px (10px padding , border of 20px on right) of container.
  • if photo isn't big enough take 70% of container, content container width should grow , photo container width shrink.
  • the height of content container (which news/blog post) should never taller or shorter image. if contents overflow, should scrollable.
  • to prevent block being absolutely super tall, shouldn't have height on 1000px (i'm think maybe setting image max-height way this.

i feel i've been on internet trying figure out how this, , have had no luck.

below mark-up , styling:

<div id="container">     <div class = "content">         <h5>             blah         </h5>     </div>     <div class = "image">         <img src="http://www.blah.com/blah.jpg" />     </div> </div>  #container {     display: inline-table;     width: 100%;     border-bottom: 20px solid #cc0000; } #container .content {     display: table-cell;     vertical-align: top;     min-width: calc(30% -40px);     border-right: 20px solid #383838;     padding: 10px;     background: #eee;     max-height: 100%;     overflow:scroll; }  #container .image {     display: table-cell;     width: 70%;     padding: 0px;     background: #ccc;     max-height: 100%; }  img {     max-width: 100%; } 


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -