| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>038 background properties</title>
- <style>
- html, body { margin: 0; padding: 0; background: #ffffff; color: #202020; }
- body { font-family: sans-serif; font-size: 13px; padding: 10px; }
- h1 { font-size: 20px; margin: 0 0 6px 0; }
- p { margin: 0 0 10px 0; }
- .pane { float: left; width: 440px; margin-left: 10px; }
- .label { background: #eeeeee; padding: 4px 6px; margin-bottom: 4px; }
- .row { clear: both; margin-bottom: 10px; }
- .tile { width: 194px; height: 128px;
- background: #dddddd url(TILE.PNG) repeat; background-size: 64px; }
- .tile-ref { width: 194px; height: 128px; background-color: #dddddd; }
- .tile-img { float: left; width: 64px; height: 64px; }
- .pos { width: 194px; height: 122px; background-color: #dddddd;
- background-image: url(PIC.BMP); background-size: 64px;
- background-position: 20px 10px; background-repeat: no-repeat; }
- .pos-ref { width: 194px; height: 122px; background-color: #dddddd;
- padding: 10px 0 0 20px; box-sizing: border-box; }
- .contain { width: 120px; height: 60px; background-color: #dddddd;
- background-image: url(PIC.BMP); background-size: contain;
- background-position: center; background-repeat: no-repeat; }
- .contain-ref { width: 120px; height: 60px; background-color: #dddddd;
- padding-left: 12px; box-sizing: border-box; }
- .cover { width: 120px; height: 120px; background-color: #dddddd;
- background-image: url(TILE.PNG); background-size: cover;
- background-repeat: no-repeat; }
- .caption { clear: both; color: #555555; padding-top: 2px; }
- </style>
- </head>
- <body>
- <h1>038 · background repeat, position and size</h1>
- <p>Each pair must look identical. The tile source is 64×64; PIC.BMP is 194×122.</p>
- <div class="pane">
- <div class="label">A · background properties</div>
- <div class="row"><div class="tile"></div>
- <div class="caption">background shorthand URL, repeat, size: 64px</div></div>
- <div class="row"><div class="pos"></div>
- <div class="caption">no-repeat, position: 20px 10px, size: 64px</div></div>
- <div class="row"><div class="contain"></div>
- <div class="caption">contain, centered</div></div>
- <div class="row"><div class="cover"></div>
- <div class="caption">cover in a 120×120 box</div></div>
- </div>
- <div class="pane">
- <div class="label">B · reference</div>
- <div class="row"><div class="tile-ref">
- <img class="tile-img" src="TILE.PNG" width="64" height="64">
- <img class="tile-img" src="TILE.PNG" width="64" height="64">
- <img class="tile-img" src="TILE.PNG" width="64" height="64">
- <img class="tile-img" src="TILE.PNG" width="64" height="64">
- <img class="tile-img" src="TILE.PNG" width="64" height="64">
- <img class="tile-img" src="TILE.PNG" width="64" height="64">
- </div><div class="caption">six 64×64 images, 3 per row</div></div>
- <div class="row"><div class="pos-ref">
- <img src="PIC.BMP" width="64">
- </div><div class="caption">image at 20,10, width 64</div></div>
- <div class="row"><div class="contain-ref">
- <img src="PIC.BMP" width="95">
- </div><div class="caption">image width 95, centered</div></div>
- <div class="row"><div><img src="TILE.PNG" width="120" height="120"></div>
- <div class="caption">120×120 image</div></div>
- </div>
- </body>
- </html>
|