Created
March 18, 2012 11:05
-
-
Save anselmh/2070569 to your computer and use it in GitHub Desktop.
Untitled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- content to be placed inside <body>…</body> --> | |
| <div class="ym-wrapper"> | |
| <div class="ym-wbox ym-clearfix"> | |
| <h1>flexible fluid <figure></h1> | |
| <figure class="float-left"> | |
| <img src="http://farm1.staticflickr.com/113/312754502_a1c6ac91e0_m.jpg" title="" alt="" /> | |
| <figcaption> | |
| Photo by <a href="http://www.flickr.com/photos/gadl/">gadl</a> - Lorem ipsum dolor sit amet, | |
| consetetur sadipscing elitr, sed diam | |
| </figcaption> | |
| </figure> | |
| <h2>display: inline</h2> | |
| <p>This <figure> element is <em>display:inline</em> and floating left.</p> | |
| <h4>Pro:</h4> | |
| <ul> | |
| <li>floating works</li> | |
| <li>image is not wider as original</li> | |
| <li>max-width of 50% works for <figure></li> | |
| <li>image is scalable</li> | |
| </ul> | |
| <h4>Contra:</h4> | |
| <ul> | |
| <li><figure> is wider than the image inside (exactly the 50% from max-width)</li> | |
| </ul> | |
| <hr /> | |
| <figure class="float-right table"> | |
| <img src="http://farm1.staticflickr.com/231/463596797_23cc2ad8c8.jpg" title="" alt="" /> | |
| <figcaption> | |
| Photo by <a href="http://www.flickr.com/photos/gadl/">gadl</a> - Lorem ipsum dolor sit amet, | |
| consetetur sadipscing elitr, sed diam | |
| </figcaption> | |
| </figure> | |
| <h2>display: table</h2> | |
| <p>This <figure> element is <em>display:table</em> and floating right.</p> | |
| <h4>Pro:</h4> | |
| <ul> | |
| <li>floating works</li> | |
| <li>image is not wider as original</li> | |
| <li><figcaption> is not wider as the image</li> | |
| </ul> | |
| <h4>Contra</h4> | |
| <ul> | |
| <li>image is not scalable</li> | |
| <li>max-width for <figure> doesn't work</li> | |
| <li>image, <figure> and <figcaption> are always at the original image width</li> | |
| <li>by the way a fixed width like <em>width:50%</em> doesn't work for display:table</li> | |
| </ul> | |
| <hr /> | |
| <figure class="float-left block"> | |
| <img src="http://farm1.staticflickr.com/113/312754502_a1c6ac91e0_m.jpg" title="" alt="" /> | |
| <figcaption> | |
| Photo by <a href="http://www.flickr.com/photos/gadl/">gadl</a> - Lorem ipsum dolor sit amet, | |
| consetetur sadipscing elitr, sed diam | |
| </figcaption> | |
| </figure> | |
| <h2>display: block</h2> | |
| <p>This <figure> element is <em>display:block</em> and floating left.<br /> | |
| <strong>The same result with <em>display:inline</em>!</strong></p> | |
| <h4>Pro:</h4> | |
| <ul> | |
| <li>floating works</li> | |
| <li>image is not wider as original</li> | |
| <li>max-width of 50% works for <figure></li> | |
| <li>image is scalable</li> | |
| </ul> | |
| <h4>Contra:</h4> | |
| <ul> | |
| <li><figure> is wider than the image inside (exactly the 50% from max-width)</li> | |
| </ul> | |
| <hr /> | |
| <figure class="float-left inline-block"> | |
| <img src="http://farm1.staticflickr.com/113/312754502_a1c6ac91e0_m.jpg" title="" alt="" /> | |
| <figcaption> | |
| Photo by <a href="http://www.flickr.com/photos/gadl/">gadl</a> - Lorem ipsum dolor sit amet, | |
| consetetur sadipscing elitr, sed diam | |
| </figcaption> | |
| </figure> | |
| <h2>display: inline-block</h2> | |
| <p>This <figure> element is <em>display:block</em> and floating left.<br /> | |
| <strong>The same result with <em>display:inline</em>!</strong></p> | |
| <h4>Pro:</h4> | |
| <ul> | |
| <li>floating works</li> | |
| <li>image is not wider as original</li> | |
| <li>max-width of 50% works for <figure></li> | |
| <li>image is scalable</li> | |
| </ul> | |
| <h4>Contra:</h4> | |
| <ul> | |
| <li><figure> is wider than the image inside (exactly the 50% from max-width)</li> | |
| </ul> | |
| <hr /> | |
| <figure class="float-left block"> | |
| <img src="http://farm1.staticflickr.com/113/312754502_a1c6ac91e0_m.jpg" title="" alt="" /> | |
| </figure> | |
| <h2>display: block (without caption)</h2> | |
| <p>This <figure> element is <em>display:block</em> and floating left.<br /> | |
| <strong>The same result with <em>display:inline</em>!</strong></p> | |
| <h4>Pro:</h4> | |
| <ul> | |
| <li>floating works</li> | |
| <li>image is not wider as original</li> | |
| <li>max-width of 50% works for <figure></li> | |
| <li>image is scalable</li> | |
| </ul> | |
| <h4>Contra:</h4> | |
| <ul> | |
| <li>no caption</li> | |
| </ul> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"view":"split-vertical","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment