Hyphens in HTML and CSS

  • When you want to display a large quote, the <blockquote> element can be used
  • By default, it will indent the text on the left and right.
<blockquote>
  This is a big quote<br />
  of many lines of text.
</blockquote>
  • If you want to display a quote as an inline bit of text then we use a <q> element.
<q>This is a smaller quote.</q>
  • There are three types of dashes that you can put in text: hyphen, en-dash, and em-dash
  • Grammatically, each has a different purpose.
  • Hyphens are the shortest dash. They are used to connect words. Represented with a &hyphen;
  • en-dash are used for a range of values. Like 12 - 17. Represented with a &ndash;
  • em-dash are used to indicate a pause in thought and indicate that a sentence is not finished. Represented with a &mdash;
  • The character entity for a shy-hyphen is &shy; which is used to indicate to the browser where a hyphen could be added, if required.
  • HTML character entities for punctuation
  • Em vs En Dash
Last Updated: : 8/26/2019, 2:39:05 PM