HTML (Hyper Text Markup Language) is used to create web pages all over the internet. And while you may not be a webmaster, you're likely crafting blog posts, publishing landing pages, and sending email campaigns.
Luckily this page will decode the code you need to know (ha, how meta), to be an agile marketer. If you want your IT or web design teams to take on the heavy lifting, go for it! But we believe every marketer should be equipped with the basic HTML knowledge needed to adjust content in an agile marketing fashion. Let's get started.
In simplest terms, HTML focuses on website structure whereas CSS (Cascading Style Sheets) focuses on website appearance. HTML defines things like “this section is the sidebar,” “this text is a list,” or “this word is a link.” With HTML, all of that jumbled text comes together into a nicely structured webpage.
Using CSS, you can easily change the appearance of your website and makes changes that are site-wide. You can keep the commands for the style stuff –fonts, colors, and so on – separate from the commands for the content. They’re called “cascading” because you can have multiple style sheets, with one style sheet that inherits properties (or “cascades”) from others.
For a lot of people, a simple web template is good enough. It’s only when you want to start customizing the look of a site that you need to delve into CSS.
Now here's the thing. While HTML and CSS are distinct coding languages, the two overlap when it comes to hacking code for marketing. As marketers, we often work on an agile basis. We need to publish a blog post instantly, send an email immediately, or publish a landing page quickly. In these moments, we can't wait for custom styling. We can't wait for someone with domain expertise on coding to make our tweaks and adjustments. We need to launch our campaigns and start seeing results fast.
That's where HTML and CSS overlap for us. While HTML traditionally focuses on structure, the code you're about to learn will include HTML tags that will add some styling magic to your web content. Let's dive in.
To jump to a specific section, just click one of the links below.
We'll also provide additional resources from HubSpot and Codecademy to continue your education as suited for your marketing needs.
Let's start by understanding what an HTML tag is. An HTML tag consists of keywords within angle brackets (<>) that describe the way you want content to appear on a page.
Let's describe this through a basic paragraph tag. It'll look something like:
<p> Your paragraph content goes here. </p>
Every tag begins with open brackets (<p>) and ends with a closed bracket (</p>). This is just so the structure is laid out appropriately, but most importantly, so the web browser can interpret the language and know what structure it should display.
Let's take a look at the basic structure of a web page, which always starts with <!DOCTYPE html>. This is so the browser understands it is reading an HTML structure:
<!DOCTYPE html>
<html>
<body>
<h1>This is our main header</h1>
<p>This is our first paragraph</p>
</body>
</html>
This small strip of HTML starts with a <body> tag in order to mark the beginning of the body content. Within this language, there are headers you can use to organize your content. These header tags range from <h1> to <h6>, with h1 being the largest-size header and h6 the smallest one (you'll see these again in the second section).
And little by little, it all starts to come together. Some of the tags are pretty intuitive, like the <p> tag for paragraphs.
There are many additional HTML tags you can use to alter the structure to your web content, but from a general overview, this isn't so bad, right? Now that you have a basic understanding of it, we can jump into 12 additional HTML tags you can use.
The days of essay-like web content are quickly disappearing. Today, content you share needs to be structured in a user-friendly format that allows folks to either read the article in-depth or scan through the key points. Here are the top three header tags:
<h1> Your Header Text Here </h1>
<h2> Your Header Text Here </h2>
<h3> Your Header Text Here </h3>
Here's how these three header tags look in action:
When creating content, you should always attribute information such as stats, quotes, or photos back to their original source. This goes beyond stating the source name. Ideally you should provide an inbound link to the source. Here's the HTML tag to do that:
<a href="url"> Source URL </a>
Paragraphs have about a 1.5 line spacing before and after each block of text, which can be seen in your content's source code with a paragraph tag:
<p> With marketing love, </p>
<p> Anum </p>
Imagine formatting an email where you need the signature message and name to align. This is where you wouldn't want the extra spacing, and can use the break rule:
<p> With marketing love, <br>
Anum </p>
With marketing love,
Anum
If you wanted to insert nonbreaking space -- for instance, extra space between words -- you simply need to add the code:
You can see this in action in this video:
Visual content is used throughout your marketing. Let's say you're building a landing page and want to feature an image that visualizes the promotional offer available on that page. Here's the code you'd see:
<img src="image file link" width="300" height="200" alt="keyword description">
You'll notice that this code includes three important factors:
With an actual URL and keyword description in the code, here's what you'll see ... an image!
And as a side note, if you like the image above, it's from our collection of 200+ free holiday stock photos. You can download and use the photos in any of your marketing assets.
When creating web content, varying structure can help you hit a message home. One of my favorite content organization tools is the list. Let's start with the code for an unordered list:
<ul>
<li> first line item</li>
<li> second line item</li>
<li> third line item</li>
</ul>
Now let's look at the code for ordered lists:
<ol>
<ol>
<li> first line item</li>
<li> second line item</li>
<li> third line item</li>
</ol>
Unordered lists in action:
Ordered lists in action:
You'll notice in the code to your right that the codes are almost identical. The tag "ul" simply means unordered list while "ol" means ordered list. See, isn't code so straight forward?
Let's say your web design team just sent over a completed web page for your next campaign, but you want to separate part of the content by adding in one, quick, line between the content. You need to launch the campaign the next day and don't want to go back to the web team yet again. No worries! Here's the HTML tag to add to the page's code:
<hr>
Boom. Done.
Inbound marketing is cool.
Inbound sales is cool.
Line breaks are cool, too.
Every CMS or COS should allow you to easily bold, italicize, and underline text in your content. But sometimes you're messing with the title module of your page, or another component of a blog post, and need to input the code. In those instances:
<b> text to bold here </b>
<strong> text to bold here </strong>
<u> text to underline here </u>
<i> text to italicize here </i>
<em> text to italicize here </em>
You'll notice more than one tag for bolding and italicizing. This is because different CMS and COS's use different tags. They shouldn't vary extensively, and the codes shown to your right are the primary ones. Then with just little bit of formatting, magic happens:
Words can be emphasized.
Words can be demanding.
Words can be persuasive.
If you're building a customer testimonial page or writing a blog post after an interview with a thought leader, it can be helpful to make interesting quotes from the piece stand out.
Here's a simple code to help:
<blockquote> "Your quote here." </blockquote>
For blockquotes, the appearance will vary based on the platform and template you're using. For this guide, I'm using a very simple HubSpot template, so a blockquote in this case adds a strong indent to the content so it stands out from the rest of the content, as you can see below:
"This is so inspirational."
To amplify the reach of your content, it's helpful to include social share links. Whether you're hyperlinking words or images, the following codes can help:
LinkedIn: http://www.linkedin.com/shareArticle?mini=true&url=URL
Facebook: http://www.facebook.com/sharer/sharer.php?u=URL
For Twitter, the code gets a bit complicated. An easier solution is to simply head to clicktotweet.com, enter your tweet, hit "generate code," and use the generated URL as a normal hyperlink.
You can see these codes in action in image form below. The social media icons below are actually from our collection of 135 free icons to help design and optimize your content. Each has been hyperlinked using the codes explained to your right with the destination being the download page for the very icons I mentioned!
As simple as the horizontal line tag is the line break tag. This simple tag comes in handy when you're trying to simply add blank space between content. It looks like this:
<br>
Easy peasy.
You see words here.
Now you see words here, with extra white space in between this line and the previous one! Of course this isn't a proper use case for the line break tag. It is, however, helpful when you're trying to add space between a main header and paragraph copy or between an image and text.
Let's say you're working on an email and want to center align an image or a body of text within the message.
Here's the tag you can use:
<center> Testimonial from Ben </center>
When it comes to right, left, bottom, and top alignment, the codes change from HTML 4 to 5. Your CMS or COS should help you make such adjustments easily.
Once upon a time there was a marketer named Ben. Ben didn't know how to code. But after using simple resources like this, and then advancing to further courses through Codecademy, Ben was able to learn how to code.
Testimonial from Ben
"When I first started my customer marketing role, I had no background in coding. But I was able to pick it up."
Let's say you're putting together a web page showcasing HTML tags for marketers to learn the basics of code. In this case, it might help to have the specific HTML tags stand out in a different color. Here's the code you would use to change the font color to a different, basic web color:
<font color= "green"> This is text on your web page. </font>
This is text on your web page. It's green like the Hulk.
Depending on your COS or CMS you may notice the code to the left change. If it does, it'll likely look like this:
<span color="green" style="color: green;"> This is text on your web page. </span>
While the HTML tag for color we showed in the previous section allows you to use basic web colors, that may not be sufficient if you want to adjust colors to match your brand.
First, you'll need to know the HEX code for your brand color. A HEX code is a six digit code that identifies a specific color on the web. You can use free browser extensions, like ColorZilla, to pick up any HEX code. That way, if you're not sure what your brand HEX code is, you can just use the tool to pick up the color. Then you just need to input that code into the tag below:
<font color= "#F667F1"> These are the words I want in a different color </font>
These are the words I want in a different color.
If you'd like to better understand how to grab the HEX color mentioned, here's a quick video showing how to do so with ColorZilla.
When you're working on marketing content, you want your visitors, leads, and customers to consume the content. I mean, that's why you made it, right? To avoid pushing folks off your content when trying to weave in inbound links, use this tag to have your links automatically open in a new window:
<a href="URL goes here" target="_Blank"> the copy you want linked goes here </a>
Now as you can see, if you clicked here, you'd be taken to the homepage of our Inbound Hub ... but in a new tab!
At the beginning of this page, we provided a table of contents that allowed you to jump down to specific sections. That was possible through internal linking. This involves two steps:
First, you'll need to hyperlink the words you want linked with a hashtag and unique name. So if I was creating the internal link for section two under my table of contents, I can use the unique ID "#sectiontwo." You can see how I then linked this in HubSpot here:
Next, you need to go to the content you actually want the link to go to and add the following code to the beginning:
<a id="UNIQUE-NAME"></a>
The code for my example would then look like:
<a id="sectiontwo"></a>
You can see below that I went to the part of my page for section two and added this line of code right before the location I want linked to:
If you followed the instructions to the left, you should be able to successfully create an internal link anywhere on your web page. If you click here, you'll be brought right back up to section two!
The important part of this code is to simply create your own unique ID. It doesn't matter what this unique identifier is so long as it is the same in both the hyperlink and the string of code.
In case you want a refresher on any of the codes we already covered, I used this internal linking code to create links to every HTML tag we talked about. Now you can see this code in action over and over again!
The HTML tags presented here are the very basics of HTML. And many of them are no more than HTML hacks to help you make adjustments on the fly or when a web developer is not around. For example, to properly change the color of your content, you should be using CSS (the "clothing" of your content) not HTML (the "body" of your content).
But as stated, these HTML hacks will help you make minor style changes. To advance your coding knowledge, we recommend enrolling in free Codecademy courses.