DEV Community

MoonLight
MoonLight

Posted on

block element and inline element

Image description

<p>This paragraph is a block-level element; its background has been colored to display the paragraph's parent element.</p>
Enter fullscreen mode Exit fullscreen mode
p { background-color: #8ABB55; }
Enter fullscreen mode Exit fullscreen mode

Image description

inline elements example :
Image description

.highlight {
  background-color:#ee3;
}
Enter fullscreen mode Exit fullscreen mode
<div>The following span is an <span class="highlight">inline element</span>;
its background has been colored to display both the beginning and end of
the inline element's influence.</div>
Enter fullscreen mode Exit fullscreen mode

Image description

Top comments (0)