Last active
July 11, 2022 06:59
-
-
Save csssecrets/82eb1575806f6eff9c37 to your computer and use it in GitHub Desktop.
Intrinsic sizing
This file contains 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
/** | |
* Intrinsic sizing | |
*/ | |
figure { | |
max-width: 300px; | |
max-width: min-content; | |
margin: auto; | |
} | |
figure > img { max-width: inherit } | |
/* Basic styling */ | |
figure { | |
padding: 10px; | |
border: 1px solid silver; | |
} |
This file contains 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
<p>Let’s assume we have some text here. Bacon ipsum dolor sit amet turkey veniam shankle, culpa short ribs kevin t-bone occaecat.</p> | |
<figure> | |
<img src="http://csssecrets.io/images/adamcatlace.jpg" /> | |
<figcaption> | |
The great Sir Adam Catlace was named after Countess Ada Lovelace, the first programmer ever. | |
</figcaption> | |
</figure> | |
<p>We also have some more text here. Et laborum venison nostrud, ut veniam sint kielbasa ullamco pancetta.</p> |
This file contains 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
// alert('Hello world!'); |
This file contains 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","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment