Skip to content

Commit 111304f

Browse files
committed
display_properties_revised
1 parent ae52cd8 commit 111304f

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

index.html

+14-9
Original file line numberDiff line numberDiff line change
@@ -2880,28 +2880,33 @@ <h3 class="heading">Display Properties</h3>
28802880

28812881
<p class="explanationText">We can create a grid of boxes that fills the browser width and wraps nicely.This can be done using with inline-block, inline-block elements are like inline elements but they can have a width and height.</p>
28822882

2883-
<xmp class="code">.box{
2883+
<xmp class="code"><style>.box{
28842884
width: 200px;
28852885
height: 100px;
28862886
margin: 1em;
28872887
color: cornflowerblue;
28882888
}
2889+
</style>
2890+
<div class="box">Box-One</div>
2891+
<div class="box">Box-Two</div>
2892+
<div class="box">Box-Three</div>
2893+
<div class="box">Box-Four</div>
28892894
</xmp>
28902895
<p class="explanationText">This will result in..</p>
28912896
<div class="output-window">
2892-
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;"></div>
2893-
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;"></div>
2894-
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;"></div>
2895-
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;"></div>
2897+
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;">Box-One</div>
2898+
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;">Box-Two</div>
2899+
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;">Box-Three</div>
2900+
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;">Box-Four</div>
28962901
</div>
28972902

28982903
<p class="explanationText">now applying <b>display: inline-block; </b>we get..</p>
28992904

29002905
<div class="output-window">
2901-
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;display: inline-block;"></div>
2902-
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;display: inline-block;"></div>
2903-
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;display: inline-block;"></div>
2904-
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;display: inline-block;"></div>
2906+
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;display: inline-block;">Box-One</div>
2907+
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;display: inline-block;">Box-Two</div>
2908+
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;display: inline-block;">Box-Three</div>
2909+
<div style="height:100px;width:200px;margin:1em;background-color:cornflowerblue;display: inline-block;">Box-Four</div>
29052910
</div>
29062911

29072912
<p class="explanationText">The boxes adjust themselves according to the browser window itself!</p>

0 commit comments

Comments
 (0)