ThomasStarck (Talk | contribs) |
ThomasStarck (Talk | contribs) |
||
Line 39: | Line 39: | ||
<style type="text/css"> | <style type="text/css"> | ||
− | + | #box{ | |
− | + | position: relative; | |
− | + | width: 50%; /* desired width */ | |
− | + | border: dashed; | |
+ | } | ||
+ | #box:before{ | ||
+ | content: ""; | ||
+ | display: block; | ||
+ | padding-top: 100%; /* initial ratio of 1:1*/ | ||
+ | } | ||
+ | #content{ | ||
+ | position: absolute; | ||
+ | top: 0; | ||
+ | left: 0; | ||
+ | bottom: 0; | ||
+ | right: 0; | ||
+ | background-color: red; | ||
+ | } | ||
} | } | ||
Line 50: | Line 64: | ||
</script> | </script> | ||
− | |||
− | |||
− | |||
<div id="GeneralContent"> | <div id="GeneralContent"> | ||
<div id="MainContent"> | <div id="MainContent"> | ||
− | <div id=" | + | <div id="box"> |
− | + | <div id="content" class="block">Aspect ratio of 1:1</div> | |
+ | </div> | ||
</div> | </div> | ||
</div> | </div> | ||
</html> | </html> |
Revision as of 15:32, 31 August 2018
Aspect ratio of 1:1