CSS for display-test2

  <script>
    html  { background-color: red; }  # 0,0,0,1
     html *  { padding 5px; }  # 0,0,0,1
     body  { background-color: gray; margin: 10px; border: 2px black solid; width: 450px; }  # 0,0,0,1
     .inl  { display: inline; width: 200px; }  # 0,0,1,0
     .blk  { display: block; width: 200px; }  # 0,0,1,0
  </script>
  

Page Content

<h3>Controlling 'display' attribute using 'class' values<h3>
<p class="inl" style="background-color: blue;">paragraph 1 is 'display:inline;' and various other texts.
with more filler: blagh blagh blagh blah</p>
<p class="blk" style="background-color: green;">paragraph 2 is 'display: block;' and various other texts.
with more filler: blagh blagh blagh blah</p>
<p class="inl" style="background-color: yellow;">paragraph 3 is 'display:inline;' and various other texts.
with more filler: blagh blagh blagh blah</p>
<p class="blk" style="background-color: brown;">paragraph 4 is 'display: block;' and various other texts.
with more filler: blagh blagh blagh blah</p>

  

Controlling 'display' attribute using 'class' values

paragraph 1 is 'display:inline;' and various other texts. with more filler: blagh blagh blagh blah

paragraph 2 is 'display: block;' and various other texts. with more filler: blagh blagh blagh blah

paragraph 3 is 'display:inline;' and various other texts. with more filler: blagh blagh blagh blah

paragraph 4 is 'display: block;' and various other texts. with more filler: blagh blagh blagh blah