Markdown has rapidly become the standard formatting language for technical writing and documentation. Its simplicity, portability and ubiquity have made it a favorite of developers, bloggers and creators of all types.
One lesser known Markdown capability is text highlighting. When used appropriately, highlights can greatly improve readability and information recall.
They guide the eye to important sections, create visual contrast for quick scanning and enforce information hierarchy.
In this comprehensive guide based on evidenced research principles, we will cover:
- Multiple methods to highlight text using standard Markdown and HTML
- Custom styling options for personalized highlight colors/formats
- Specific use cases for optimal highlight placement
- Statistics on the measurable benefits of highlighting for comprehension & retention
Whether you are writing technical tutorials, software docs, troubleshooting guides or marketing materials, the highlighting techniques in this guide will help you draw instant focus to the most critical information.
Built-In Highlight Options in Markdown
There are two main approaches for highlighting text naturally in Markdown – equal signs and the HTML <mark>
tag:
==Equal Sign Highlight==
<mark>HTML Mark Tag Highlight</mark>
The output looks identical by default:
==Equal Sign Highlight==
HTML Mark Tag Highlight
But there are some subtle syntax differences to consider:
Equal Signs
- Place signs directly before and after text
- Highlight words, sentences or multi-paragraph sections
- Must precisely match beginning and ending signs
Mark Tag
- Wrap text in opening and closing HTML tags
- Flexible highlighting of all text sizes
- Mixes cleanly with other HTML
For consistency, I recommend sticking with one primary method. The simplicity of the double equal signs approach requires very little syntax adaptation from standard Markdown, so it tends to be easiest.
But as we will cover next, both methods can be customized and tailored for more advanced highlighting applications.
Comparative Code Examples
Here is a side-by-side code example applying the two main highlight approaches:
Here is some text with a ==highlighted== word.
==This is a highlighted sentence.==
==This paragraph will be
highlighted with the default
yellow background style.==
Here is some text with a <mark>highlighted</mark> word.
<mark>This is a highlighted sentence.</mark>
<mark>This paragraph will be
highlighted with the default
yellow background style.</mark>
And the rendered visualization:
Here is some text with a ==highlighted== word.
==This is a highlighted sentence.==
==This paragraph will be
highlighted with the default
yellow background style.==
Here is some text with a highlighted word.
This is a highlighted sentence.
This paragraph will be
highlighted with the default
yellow background style.
You can see the core syntax is very similar. The only major difference is whether HTML tags or Markdown-native equal signs are used for applying highlights.
So choose the approach that best fits your comfort level and technical constraints. But stick with one or the other for uniformity.
Next let‘s explore how to customize styling.
Customizing Highlight Colors and Styles
The default highlighting style is a light yellow background color. This works well for most purposes by catching the eye without being distracting.
However, highlights can be tailored to suit brand styles or specific sections of content.
There are two main customization options:
- Change default highlight styling
- Use custom CSS classes
For technical writers distributing Markdown, both approaches are viable depending on whether site-wide or selective style changes are needed.
Modifying Highlight Defaults
In applications like Typora, themes allow changing highlight parameters globally.
Navigate to Theme
> Open Theme Folder
in Typora, then edit the base.user.css
file.
We can customize the highlight style like this:
mark {
background-color: #ADD8E6; /*light blue*/
color: black;
font-weight: bold;
font-style: italic;
}
Now all mark
tag highlights will use that styling.
For equal sign highlights, we would update this class instead with the same CSS properties:
mark {
/* Styles here */
}
.md-text-color-theme {
/* Styles here */
}
So all highlights can be modified site-wide by tweaking the theme.
Custom CSS Classes
When programmatically rendering Markdown such as through Markdown Here, we can utilize custom CSS classes to target specific highlights instead.
For example:
<style>
.warning {
background-color: #ffb3b3;
}
</style>
This is regular <mark>highlighted text</mark>.
This is a <mark class="warning">warning message</mark>!
Now certain highlights can stand out from default formatting using unique styling rules.
Custom CSS classes give full control for one-off highlighting cases necessary in certain content types and applications.
Plus, colors can be matched to brand guidelines as needed.
Technical Considerations
Changing highlight style defaults affects highlighting output globally. This presents technical tradeoffs:
- Simple uniform highlights via default styling
- Greater customization using CSS rules
Out-of-the-box defaults limit control but offer set-it-and-forget consistency across platforms.
Custom CSS provides reader-friendly personalization at the cost of greater design upkeep.
Ultimately, the best approach depends on your content and applications.
For example, software documentation benefits heavily from semantic coloring for warnings, errors, etc. So custom styling adds value despite being more complex.
But blog content renders perfectly fine with basic styling across devices. Custom highlights would just impose unnecessary maintenance overhead.
In other words, let the use case determine whether default or customized highlighting makes the most sense.
Best Practices for Highlight Placement
Highlighting draws the eye to important details. But the effect is diminished if used to excess.
Follow these best practices for optimal highlight placement:
Use Sparingly
Avoid arbitrarily highlighting. Instead, only apply to critical text:
✅ Do
Our new <mark>Alert Banner feature</mark> adds customizable warnings.
❌ Don‘t
Our new <mark>Alert</mark> <mark>Banner</mark> feature adds <mark>customizable</mark> warnings.
Too many highlights fight for attention.
Consistent Selection
Use similar criteria when determining what to highlight:
✅ Do
- New <mark>features</mark> in Version 5.3
- Deprecated <mark>API</mark> endpoints
❌ Don‘t
- New <mark>features</mark> in latest release
- Old endpoints removed
Irregular highlighting feels arbitrary.
Semantic Colors
Use colors intentionally, especially for notation warnings:
✅ Do
This API will <mark class="deprecated">change</mark> in v6.
<mark class="warning">Caution:</mark> This action is permanent!
❌ Don‘t
This API will <mark>change</mark> in v6.
<mark>Caution:</mark> This action is permanent!
Color coding by semantics creates intuitive association.
Follow these best practices to guide readers without distracting.
Use Cases for Highlighting Text
Now let‘s explore some prime real-world examples of using text highlighting effectively.
Software Documentation
Developer documentation often contains both conceptual exposition and code examples. Highlights help connect these elements for enhanced comprehension.
For instance, documentation might describe a new registration function then demonstrate its signature and usage:
```js
function registerUser(name, email) {
// Implementation
}
```
The new <mark>registerUser()</mark> method registers an account.
The highlight connects prose discussion to the related code sample.
Other types of technical highlights include:
- Parameters – Highlight parameter names in method signatures
- Errors – Indicate error names/values from stack traces
- Input Prompts – Show expected user input values
- Constants – Identify important but otherwise non-descriptive constants and magic numbers embedded in code flow
Thoughtful use of highlights helps orient readers scanning technical documentation.
Support Articles
Highlights also enhance troubleshooting guides and help documentation by pointing to resolution steps.
For example, an instructional passage might highlight key actions:
To resolve the issue, first reload the page. Then clear your browser cache and test again.
If still failing, restart your device.
This quickly directs readers without extra verbiage.
Other highlight applications include:
- Resolutions
- Workarounds
- Setup prerequisites
- Environment details
Attention-catching highlights frontload critical details for support article skimmers.
Training Materials
Learning resources similarly benefit from highlights by introducing new terminology:
Web applications utilize a client-server model to deliver information to users. The client is the application the user interacts with, usually a web browser. The server handles application logic and data storage.
Highlighted keywords aid retention as readers assimilate new domain knowledge.
Marketing Copy
Sparing use of highlights can also draw attention to selling points:
Our online courses give you access to 300+ downloadable resources to accelerate your coding education!
But resist urge to overhighlight marketing content, as benefits become less distinct.
Improved Analytics
Data has shown properly used highlights can achieve measurable improvements in reading comprehension and information retention compared to non-highlighted content.
According to Microsoft‘s research, test subjects demonstrated a 55% increase in recall of highlighted terminology definitions compared to non-highlighted peers.
Another study focusing on textbook highlighting found students scored 14-17% higher on reading comprehension assessments.
So when crafted judiciously, highlights empirically enhance engagement and recall.
They serve an important learning aid role that data continues to support.
Of course many other great highlight use cases exist. But the examples here demonstrate optimal placement patterns for common document types.
The unifying theme is using highlighting to orient readers where their attention is needed most. Keep this principle in mind as you determine what to highlight to tangibly boost information retention and comprehension.
Summary – Key Highlight Takeaways
Text highlighting is an invaluable yet underutilized tool for improving technical writing clarity. The core concepts:
- Highlight using double equal signs or
<mark>
tags - Customize colors/styles through theme CSS or classes
- Place purposefully, use sparingly, be consistent
- Target use cases like docs, guides, training content
- Stats show significant comprehension gains
So leverage Markdown highlighting to make your most important content instantly recognizable and memorable.
For any other questions on setup or best practices for text highlighting, please reach out!