Search
Adding visually engaging elements to content
Capture your visitor’s interest and communicate more effectively
-
Increasing engagement with icons
Instead of bloating our themes with extra font files containing icons that you may or may not use, we inline SVG icons which offer better page load performance and improved accessibility over font-based icon systems. Zendesk’s default Copenhagen theme recently made the same change with the release of the new theming API.
Our Icons page contains an excellent starter set of icons and there are many collections (and thousands of icons) available online for free like Bootstrap Icons, Heroicons and Icons8.
For more information about the differences between font-based and inline SVG icons, refer to this article.
Usage
Use
.svg-icon
with an inline SVG icon to make it scale in relation to surrounding text.Heading 1
Heading 2
Heading 3
A paragraph of text
A variety of different icons are included within each of our themes, which you can mix-and-match.
Some examples of commonly used SVG icons include:
thumbs-up
thumbs-down
star
pin
chevron-up
chevron-right
chevron-down
chevron-left
arrow-up
arrow-right
arrow-down
arrow-left
gear
Sizes
Use font size or sizing utilities can be used to control how large an icon appears.
Colors
Use
.fill-current
or.stroke-current
to set the fill or stroke color of the SVG to the current text color. Text color utilities can then be used to control the color of an icon. -
Drawing attention to information with call outs
A great way to highlight important aspects of your content is to use callouts. These are typically expressed as tips or notes, though the specific language used should be consistent with your company’s brand.
This is an example of a standard note available in all themes. You can apply this style to any content by simply applying the
.note
class name to a paragraph or container element.Warning styles can help draw visitor attention to important information:
This is an example of a standard warning available in all themes. You can apply this style to any content by simply applying the
.warning
class name to a paragraph or container element.Different styles can be created using custom CSS or utilities.
Caution
This is an example of a custom notification using utilities. You can easily customize this to suit the look-and-feel of your theme or create your own.
Each style can be used with our set of font and SVG icons to add extra visual appeal.
Boxes
Information that’s related to the main content of the page but more of an aside can be displayed within a box. As with all of our patterns, you can customize the appearance to meet your requirements using our utilities (for example, box shadows).
In summary
- This was an important point
- As was this
- And even this
- The final and most important point
-
Getting technical with code blocks
The
<code>
and<pre>
elements are for displaying inline and multiline blocks of code.Usage
Use the
<code>
element for inline code snippets.Thepush()
method adds one or more elements to the end of an array and returns the new length of the array.Use the
<pre>
element for multiple lines of code.L TE A A C V R A DOU LOU REUSE QUE TU PORTES ET QUI T' ORNE O CI VILISÉ OTE- TU VEUX LA BIEN SI RESPI RER - Apollinaire
Use
<kbd>
for input that is typically entered via keyboard.To edit settings, press ctrl + s -
Adding figures and images to articles
Use the
<figure>
element to display self-contained content, like illustrations, images, photos or code. For image-specific styles, refer to the Images page.Usage
Use the
<figcaption>
element to display a caption for a given<figure>
.Use text align utilities to align the caption relative to the image.
Image styles
Images often play an important role in content, providing useful information and helping to illustrate points. Images can be displayed within
<figure>
elements and given an optional caption using the<figcaption>
element.Using a few simple class names, you can change the alignment of your images and even have them extend slightly beyond the content area for added effect.
Use
.float-left
to have an image float to the left of the content. Responsive variants allow you to control the float based on screen size.There should be some space above, below and on the appropriate side of the image to ensure separation between the image and surrounding text. This will make the page look better and improve readability.
Margin utilities allow you to apply spacing around the image and reposition the element on larger screen sizes. Text alignment utilities can be used to control the alignment of the caption.
The left-aligned example uses
.my-5
and.lg:mr-6
to apply margin around the entire element andlg:-ml-6
to shift the image further to the left on large screen sizes.Use
.float-right
to achieve a similar (but opposite) effect. Consider using other utilities, for example borders and background colors, to add further interest to your images or apply your own styles to figures or images within the content area (.content
) using custom CSS.When floating elements it may occasionally be necessary to use
.clearfix
to ensure content remains within the content area. -
Customizing list styles
Use
.list-unstyled
to remove the default styling from<ol>
and<ul>
elements.- List item
- List item
- List item
Use
.list-item
to add additional space around each list item.- List item
- List item
- List item
- Lorem ipsum dolor sit amet, adipiscing elit.
- Nulla vitae elit libero, a pharetra augue.
- Donec id elit non mi porta gravida at eget metus.
- Quisque fringilla elit quis purus consectetur.
List style utilities provide additional control over the look-and-feel of lists.
Numbered list
Use
.list-number
to apply a custom numbered style to a list.- List item
- List item
- List item
Check list
Use
.list-check
to apply a custom checklist style to a list.- List item
- List item
- List item
Divider list
Use
.divider-list
to present list items in a horizontal list separated by a divider.- List item
- List item
- List item
The
data-divider
attribute allows you to override the divider applied before a given list item:- List item
- List item
- List item
We use this element in our themes to present call-to-actions, menus and lists of articles.
-
Emphasizing points with block and pull-quotes
Blockquotes
Use
<blockquote>
for quoting blocks of content from another source within your document.Success is not defined by the ability to have no complaints, it is defined by the ability to deal with them.
Pull-quotes
You can also emphasize parts of your content using utilities or your own custom elements. The following paragraphs help prove this point by providing a body of text in which a pull-quote can be placed.
“Your most unhappy customers are your greatest source of learning.”
You’ll notice that the quote itself is made larger and bolder using typography utilities. Space is added around the element and, on large screens, shifted left using margin utilities.
There’s really no limit to what you can do with our utilities. Of course you could create a right-aligned version that looked much the same, or create your own unique versions.
Draw inspiration from what you see online, get excited and get creating!
-
Organizing information in tables
Tables are useful for layouts where text needs to be positioned side-by-side or floating at specific locations on the page. If making these is frustrating with the usual layout tools, try using a table.
Standard table
Use
.table
with a<table>
element for a standard table.# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter Use
.hover:bg-{color}
utilities to create hover effects on rows:# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter Bordered table
Use
.table-bordered
with.table
for borders on all sides of the table and cells.# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter Borderless table
Use
.table-borderless
with.table
for a table without borders.# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter Sizes
Use
.table-sm
with.table
to create a compact table with half the padding.# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter Responsive
Wrap a
.table
with the.scroll-x
utility to make it horizontally scrollable across every breakpoint.# Heading Heading Heading Heading Heading Heading Heading Heading Heading 1 Cell Cell Cell Cell Cell Cell Cell Cell Cell 2 Cell Cell Cell Cell Cell Cell Cell Cell Cell 3 Cell Cell Cell Cell Cell Cell Cell Cell Cell Add a
{screen}:
prefix to create responsive tables up to a particular breakpoint. From that breakpoint and up, the table will behave normally and not scroll horizontally. -
Creating beautiful content with text styles
You can make the font size of a paragraph of text larger by giving it a class name of
font-size-xl
using the Source Code editor when editing an article. This can be used to emphasize a point or summarize the content of the article.This article provides an overview of some of the most common typographic elements used in articles, covering everything from headings and blockquotes to tabs and toggles. Many of these elements are applied using the editor toolbar and their appearance may differ between themes.
Headings
Use
.h1
through.h6
classes when you want to match the font styling of a heading but cannot use the associated HTML element.h1
The quick brown fox jumped over the lazy dog.
h2
The quick brown fox jumped over the lazy dog.
h3
The quick brown fox jumped over the lazy dog.
h4
The quick brown fox jumped over the lazy dog.
h5
The quick brown fox jumped over the lazy dog.
h6
The quick brown fox jumped over the lazy dog.
Use font size utilities when you need to create larger (or smaller) headings.
Inline text elements
You can use the mark tag to highlight text.
This line of text is meant to be treated as deleted text.This line of text is meant to be treated as no longer accurate.This line of text is meant to be treated as an addition to the document.
This line of text will render as underlined
This line of text is meant to be treated as fine print.
This line rendered as bold text.
This line rendered as italicized text.
Abbreviations
The HTML Abbreviation element (
<abbr>
) represents an abbreviation or acronym.Use the optional title attribute to provide an expansion or description for the abbreviation.
attr
HTML