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)

Join us at DEV
Yes, this is technically an “ad”, but really we just want to ask if you want to join DEV. We have 900k+ developers reading, posting, and enjoying community, and would love to have you.   Create an account and continue your coding journey.