Hightlight text using Markdown, CSS and HTML
To highlight text, use the tag in your
markdown.md
file, like that:
<mark>text you want to hightlight</mark>
The expected outcome is this:
text you want to hightlight
then, to customize the hightlight, add the following snippet of code to your CSS file (for example style.css
):
/* This styles the tag <mark> */
mark {
background-color: antiquewhite;
color: blue;
padding: 0 0.04em; # you can adjust lenght and height of the padding with this
}
If you did not have a CSS file and created one for this, make sure that you add the following snippet of code:
<link href="style.css" rel="stylesheet" />
in the header of index.html
, like this:
<!DOCTYPE html>
<head>
<link href="style.css" rel="stylesheet" />
</head>
<body>
</body>
</html>
so the CSS file, style.css
is sourced.