Skip to content

Instantly share code, notes, and snippets.

@sandrabosk
Forked from ross-u/README.md
Last active February 2, 2021 05:56
Show Gist options
  • Save sandrabosk/2008fc93c03514738671f63a7ee81635 to your computer and use it in GitHub Desktop.
Save sandrabosk/2008fc93c03514738671f63a7ee81635 to your computer and use it in GitHub Desktop.
Block vs Inline Elements - Cheat Sheet

HTML Introduction

Block vs Inline Elements - Cheat Sheet


Commonly used Inline elements

Element Description Example of use / Output
<em></em> Emphasizes text - semantic tag We are the best in the city
<i></i> Italic text JavaScript is a very powerful language
<strong></strong> Important text - semantic tag This is the last day to apply
<b></b> Bold text My name is Bob.
<u></u> Underlined text My name is Bob.
<time></time> Dates and times The concert starts at 12:00
<a></a> Anchor Go to Google
<br> Line break To be
Or not to be
<img> Image Go to codepen
<script></script> Embedded code Go to codepen
<span></span> Generic inline container Some text
<button></button> Clickable button Go to codepen
<input></input> Data input field Go to codepen
<label></label> Caption for item Go to codepen
<select></select> Menu of options Go to codepen
<textarea></textarea> Multi-line input

Commonly used - Block elements

Element Description Example of use / Output
<p></p> Paragraph Welcome to your website
<pre></pre> Preformated text hello world!
<h1></h1> Heading (title) Hello World!
<ol></ol> Ordered List OneTwo
<ul></ul> Unordered List OneTwo
<li></li> List Item One
<table></table> 2-D Data Go to codepen
<form></form> Submit info Go to codepen
<fieldset> Group form items Go to codepen
<hr /> Content separation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment