Skip to content

Commit 9da6b0d

Browse files
committed
simplifying media object example
1 parent cff41ac commit 9da6b0d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

flexbox/use-cases/media-flipped.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
margin: 5px;
5656
}
5757

58+
img {
59+
max-width: 100%;
60+
}
61+
5862
.media {
5963
width: 300px;
6064
border: 2px dotted rgb(96, 139, 168);
@@ -89,7 +93,7 @@
8993
<body>
9094
<section>
9195
<div class="media flipped">
92-
<img src="https://placehold.it/60x60" alt="placeholder">
96+
<div class="image"><img src="https://placehold.it/60x60" alt="placeholder"></div>
9397
<div class="content">This is the content of my media object. Items directly inside the flex container will be aligned to flex-start.</div>
9498
</div>
9599

@@ -109,7 +113,7 @@
109113
</textarea>
110114
<textarea id="code" class="playable-html">
111115
<div class="media flipped">
112-
<img src="https://placehold.it/60x60" alt="placeholder">
116+
<div class="image"><img src="https://placehold.it/60x60" alt="placeholder"></div>
113117
<div class="content">This is the content of my media object. Items directly inside the flex container will be aligned to flex-start.</div>
114118
</div>
115119
</textarea>

flexbox/use-cases/media.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,16 @@
5555
margin: 5px;
5656
}
5757

58+
img {
59+
max-width: 100%;
60+
}
61+
5862
.media {
5963
width: 300px;
6064
border: 2px dotted rgb(96, 139, 168);
6165
}
6266

63-
.media img {
67+
.media .image {
6468
margin: 0 10px 0 0;
6569
}
6670

@@ -81,7 +85,7 @@
8185
<body>
8286
<section>
8387
<div class="media">
84-
<img src="https://placehold.it/60x60" alt="placeholder">
88+
<div class="image"><img src="https://placehold.it/60x60" alt="placeholder"></div>
8589
<div class="content">This is the content of my media object. Items directly inside the flex container will be aligned to flex-start.</div>
8690
</div>
8791

@@ -98,7 +102,7 @@
98102
</textarea>
99103
<textarea id="code" class="playable-html">
100104
<div class="media">
101-
<img src="https://placehold.it/60x60" alt="placeholder">
105+
<div class="image"><img src="https://placehold.it/60x60" alt="placeholder"></div>
102106
<div class="content">This is the content of my media object. Items directly inside the flex container will be aligned to flex-start.</div>
103107
</div>
104108
</textarea>

0 commit comments

Comments
 (0)