The Beginner's Guide To HTML & CSS For Marketers
The Beginner's Guide To HTML & CSS For Marketers
1
Table of Contents
Introduction 3
What is HTML? 5
What is CSS? 6
2
Introduction
Have you ever right clicked on a web page and clicked “view page source” or looked
at the source code for an email? Or are you a former MySpace user who learned how
to update the code to add a snazzy background or song to your MySpace page? That’s
HTML. CSS is a complementary coding language that applies a style sheet to a given
page of HTML code, changing the look and feel of the page to match your brand.
3
What are Coding Languages?
Coding languages like HTML and CSS, also known as programming languages, are written instructions that
tell software what to do, how to display something, or how to process an algorithm. Common programming
languages are Java, Python, and SQL. HTML and CSS are known as declarative programming languages
that declare what is on a web page and how it should look.
4
What is HTML?
HTML, or HyperText Markup Language, uses tags to alter the structure, or how text or objects appear on a web page.
HTML tags help you to organize content, make a page easier to read, or tell search engines what the most important
keywords are using header tags. Here’s an example of a snippet of HTML code for hyperlinked text.
5
What is CSS? Image via W3 Schools
6
HTML vs. CSS Here’s an example of a blog post in HTML without CSS.
7
HTML vs. CSS: Here are the main differences
HTML CSS
1 Code for the structure of web page 1 Code for the style of web pages
2 Codes for mainly individual items and elements 2 Codes for mainly entire pages or individual pages
5 Can be processed by all browsers, 5 More style choices and options than HTML
limited technical requirements
6 Better style and formatting than HTML
6 Free, lots of available resources/support
7 Free, lots of available resources/support
7 Lacks security features
8 Not uniform between browsers
8 Limited dynamic abilities
9 Lacks security features
8
HTML Codes to Know Common HTML Tags for Marketers
9
Common HTML Tags for Marketers
10
Social sharing tags: Body tag: <body> your webpage here </body>
This tag, as seen in the full HTML page example
LinkedIn: above, is the container for the contents like
http://www.linkedin.com/shareArticle?mini=true&url=URL lists, paragraphs, hyperlinks, and images on
your webpage.
Facebook:
http://www.facebook.com/sharer/sharer.php?u=URL Line break tag: </br>
This is a really helpful code for formatting. It
By adding your desired URL to the section of this code adds a break in the text and can be used within
that says “URL,” those who click the link will automatically headers, paragraphs, or anywhere on the page
go to LinkedIn or Facebook and see a pre-populated post to move the copy after the break to the next line.
with the link provided, saving your site visitors the trouble
of copying the link to a new post themselves. This helps to
encourage social sharing and gets you more page visitors. <h1> Your header that is really long and
These can be used on blog posts or in emails and attached needs </br> to be broken up onto two
to an icon of the LinkedIn or Facebook logos. lines here </h1>
11
How to Update Your CSS Inline CSS
12
External style sheet
To update CSS using an external style sheet, you’ll create Here’s what a .css external stylesheet looks like.
a separate .css file with the desired styling for elements or
groups, then link the .html file with the .css file.
body {
Here’s how to link an external style sheet to an HTML file. background-color: lightblue;
}
<head>
h1 {
<link rel=”stylesheet” type=”text/css”
color: navy;
href=”thisisyourcssfile.css”>
margin-left: 20px;
</head>
}
13
HTML & CSS: What to Avoid
When it comes to HTML and CSS there are a few major things that developers will
tell you are big no nos. Since CSS stylesheets can apply to many pages on your site,
beware of making major changes to something that may cause changes sitewide.
Here are HTML and CSS tips on what to steer clear of when it comes to code.
HTML CSS
1 Forgetting a close bracket. For every open 1 While sometimes it makes sense to do inline CSS
bracket like an open paragraph <p> there styling and applying a style to an individual heading
must be a matching close bracket, </p>. or paragraph, usually, it is easier to make a style sheet
for the entire web page with the master styling for all
2 Always include alt tags for images. These h1, h2, h3 tags, backgrounds, margins, padding, and
help with SEO optimization and to describe other styled elements.
what’s in the image to search engines.
2 When creating CSS style sheets, group sections
3 Don’t use line breaks to create lists, accordingly and make sure everything is well-
use the list tag outlined earlier. documented.
4 Don’t forget your DOCTYPE or you’ll 3 Don’t update a style sheet if you don’t know how
risk having issues with browsers not many pages you’ll affect. Check with your developers
recognizing the document type. They may if you have questions as you could potentially break
not be able to properly read your code. pages on your site, making them unreadable.
14
RESOURCES & ADDITIONAL LEARNING