Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Adding inline CSS

From: Effective HTML Email and Newsletters

Video: Adding inline CSS

In the prior videos, we've work to code this multicolumn product email. Let's finish coding this email. Here is where we left off. As you can see, we have all of the elements: We have the copy. We have the email structured as a table so our layout works. However, our final result has a number of differences that are very important that we need to code. Specifically, we need to use CSS styles inline. Let's begin with the navigation links. The navigation links are made up of a single HTML paragraph, or p, tag that surrounds several anchor tags, or links.

Adding inline CSS

In the prior videos, we've work to code this multicolumn product email. Let's finish coding this email. Here is where we left off. As you can see, we have all of the elements: We have the copy. We have the email structured as a table so our layout works. However, our final result has a number of differences that are very important that we need to code. Specifically, we need to use CSS styles inline. Let's begin with the navigation links. The navigation links are made up of a single HTML paragraph, or p, tag that surrounds several anchor tags, or links.

We start by styling the paragraph tag, and we define the color, we define the font-family, font-size, the line-height, and then we have the typical margin and padding settings to 0. In addition, we have set the text alignment to center, so that the navigation links center within that area of the HTML email. For each link, we set the color of the link to white, we align it in the center, and we set the margin-right to 25 pixels.

We also set the text-decoration to none. With HTML email, unlike web pages, you cannot set code so that hover makes the link underlined or not underlined. Therefore in HTML email, you have a choice of either using underlines or not, text-decoration set to none or underline. The second part of the HTML email will refine with CSS styles our colors. The original email design has several colors used for the copy.

For example, this heading about Special Occasion Bouquets and Baskets is pink, the tagline underneath is blue, and then for each of the products, the product names are blue and the prices are red to pink. Finally, with colors there is a promo code below the products that is a color and needs to be styled. Let's start with the heading. We have our h1, heading1 style, and we style the color to the pink, and we set the font-family, the font-size, to a large size, the font-weight to normal instead of bold, so it looks clean.

We set the line-height, and we set the margin and padding to 0. One brief mention about line-height: the space between Special Occasion Bouquets and Baskets and the tagline underneath can be defined in any number of ways. We can use margin, we can use padding, or we can use line-height. In this case, I've chosen line-height because it seems more reliable to me in Outlook. The next bit we color is the actual tagline. As with the heading, we define a color, the font-family, the font-size, the font-style--in this case italic.

We set the font-weight to normal, as we did with the heading, and we set the line-height to 14, the same as the font size. The next bit to color are the product names and the product price. Because each of our products are wrapped in a single paragraph, or p, tag, we define the color of the product name at the paragraph level. So we define the color, the font-family; font-size, we want font-weight as normal, not bold; and we set the line-height; and we set margin and padding to 0.

In addition, we set the text-align to center. To color the price, we take the span that we had added earlier and this time we add the actual color. Then we add these inline CSS styles to every one of the products. In addition to coloring the heading the tagline, each of the product names, and the product prices, we also need to color the promo code.

We set up earlier a span around our promo code of flowers4u, and now we add the style color. Your last bit of coloring has to do with the background color behind the email. We've added a bgcolor value, which is an HTML table element, a very pale blue. We've added a very light blue background color that comes from these flowers, hydrangea deluxe. The last bit of styling we need to do are the borders around each of the products.

For now, we have set these border styles at the image level, so that every image will have a thin two-pixel border around it. And this is the result of our HTML table layouts, adding the copy, adding the CSS styles.

Show transcript

This video is part of

Image for Effective HTML Email and Newsletters
Effective HTML Email and Newsletters

55 video lessons · 22222 viewers

Tim Slavin
Author

 
Expand all | Collapse all
  1. 2m 25s
    1. Welcome
      1m 1s
    2. Using the exercise files
      1m 24s
  2. 13m 12s
    1. Understanding differences between HTML email and web pages
      1m 21s
    2. Seeing how HTML email displays in different email programs
      3m 27s
    3. Finding Acid tests and compatibility checklists
      2m 35s
    4. Understanding MIME types: HTML vs plain text
      4m 3s
    5. Exploring the future of HTML email
      1m 46s
  3. 15m 12s
    1. Defining spam
      2m 6s
    2. Examining legal issues with permission-based email
      1m 33s
    3. Planning email campaigns
      1m 36s
    4. Creating content for email campaigns
      2m 34s
    5. Understanding design constraints of HTML email
      1m 53s
    6. Designing effective HTML email
      2m 5s
    7. Building email address lists
      3m 25s
  4. 7m 28s
    1. Choosing tools for coding HTML email
      1m 27s
    2. Coding email versus coding web pages
      1m 14s
    3. Preventing problems with email coding
      2m 49s
    4. Understanding the ideal coding process
      1m 58s
  5. 17m 27s
    1. Planning
      1m 8s
    2. Coding HTML tables
      4m 38s
    3. Adding content
      4m 49s
    4. Adding inline CSS
      6m 52s
  6. 10m 44s
    1. Planning
      43s
    2. Coding HTML tables
      2m 41s
    3. Adding content
      3m 39s
    4. Adding inline CSS
      3m 41s
  7. 13m 13s
    1. Planning
      1m 13s
    2. Coding HTML tables
      3m 4s
    3. Adding content
      2m 37s
    4. Adding images
      1m 9s
    5. Adding inline CSS
      5m 10s
  8. 7m 32s
    1. Designing a plain text email
      4m 49s
    2. Designing a plain text email from an HTML email
      2m 43s
  9. 20m 45s
    1. Automating HTML email creation
      2m 5s
    2. Automating HTML email by category
      1m 6s
    3. Automating HTML email with WordPress
      5m 32s
    4. Automating HTML email with ExpressionEngine
      4m 27s
    5. Automating HTML email with FeedBurner from an RSS feed
      4m 27s
    6. Automating HTML email with FeedBlitz from an RSS feed
      3m 8s
  10. 6m 42s
    1. Deciding when and how to test email
      3m 18s
    2. Using testing services
      3m 24s
  11. 13m 56s
    1. Outsourcing your email campaign
      56s
    2. Sending email with MailChimp
      2m 40s
    3. Sending email with Campaign Monitor
      1m 51s
    4. Sending email with Constant Contact
      2m 20s
    5. Sending email with iContact
      2m 9s
    6. Sending email with VerticalResponse
      1m 52s
    7. Sending email with canned templates
      2m 8s
  12. 14m 34s
    1. Solving layout and spacing problems
      2m 50s
    2. Solving image problems
      3m 12s
    3. Solving Gmail display problems
      2m 19s
    4. Solving Lotus Notes display problems
      1m 55s
    5. Solving Outlook 2007/2010 display problems
      2m 40s
    6. Adding video to email
      1m 38s
  13. 1m 36s
    1. Next steps
      1m 36s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Effective HTML Email and Newsletters.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.