Greased Issues

Issue #5.1 June 6th, 2015 Volume 1
 

Purple
Edition

Greased: The Nerd Bacon Newsletter (Logo)


Greased 1.5 Addendum

June 6th, 2015

Difficulty: 2

EasyDifficult

Hey everyone,

As I was looking through Greased as it appears in my mailbox I noticed something strange; it's not a big deal but it's worth pointing out.

Over in the HTML Tips and Tricks section, the horizontal lines are being treated quite strangely, and it has occurred to me that they may not look the same in everyone's email program.  In fact, despite the exact same HTML/CSS copied and pasted directly from the email to the site, the web-version of Greased 1.5 ( http://nerdbacon.com/newsletter/vol-1-5 ) displays them slightly differently.  Weirdest of all, a couple of the examples actually appear differently depending on whether I'm viewing the email or writing the email.  Literally the line will look a certain way as I'm viewing it, and then when I click reply and it automatically quotes the email, it will look a different way - the way I intended it to when I drafted it.

There are a few reasons I can think of why this happens (though I can't fully explain the difference between reading and viewing emails...) but they aren't really important when it comes to understanding how to use this bit of HTML.  Though the issue is minor, I figured that it might be really confusing to those of you who may actually plan to use horizontal lines in your articles, so I thought I'd take a few moments to explain it a little more in-depth here, and at least try to offer up some more concrete examples without leaving anything to chance.  If you're not all that interested in making horizontal lines, feel free to skip the rest of this.  As I said, a basic <hr /> will be more than sufficient for most purposes; however, you may also wish to add lines of a particular color, which is one of the discrepancies encountered in the previous email.

The big difference I noticed was with how 2 examples in particular were handled.  The first was when I was illustrating how to add color to a line with "no thickness" (the default thickness is 1 pixel; if it was "0" it wouldn't be visible).  The markup for this line is <hr style="width: 80%; border-color: blue; margin-left: auto; margin-right: auto;" /> and in my email editor, this creates a blue line. However, since we haven't explicitly stated the other 2 potential border attributes, I guess some programs impose their own default styles.

What we want to do here is be 100% specific and unambiguous so that whatever is displaying the HTML knows exactly what we want to display.  Some of the hr attributes can be done purely with HTML, but I prefer to use inline CSS for consistency.

If you've been paying attention, you might've come to the conclusion that even by setting the border at a single 1 pixel we're not getting the thinnest line possible. Since each piece of the border (top, bottom, left, and right) is 1 pixel wide, our line can't be any smaller than 2 pixels; even with no height, the top and bottom borders are still stacked on top of each other. While I think this line is perfectly thin for most uses, and I thoroughly recommend the above method for creating small, colored lines, but there is a way to get rid of the border altogether.

That's it guys and ghouls.  I know we got into a lot of territory there, but I think it's important to explain (or at least start to explain) the fundamentals behind what's happening so that you understand what piece of the markup is doing what rather than just copying or referring to some random snippet of characters that has absolutely no meaning to you.  I implore you: please don't go overboard creating little boxes and lines all over the place!  Just because something can be done doesn't mean it should be done, and the examples I've given are just that: examples where the concepts in question are clearly addressed.  Whenever you're playing with this stuff, remember to keep 3 very important things in mind:

  1. SAVE your work first!
  2. NEVER delete, alter, or modify the existing HTML (when in the Text Editor)!
  3. ALWAYS click "Preview" to make sure your efforts are being displayed the way you intended; do not rely solely on the Visual Editor for an accurate representation of what the published product will look like.

If you get stuck with your lines, remember the following:

If everything checks out, you may have a syntax issue. Here are a few extra tips about formatting your HTML/CSS as well:

If everything above looks good and you still can't figure out what's going wrong, let me know and send me a screenshot if applicable and I'll do my best to help! Don't get too bogged down with these little tricks and if it gets to confusing then don't worry about it. However, if you've always been curious about how to enhance the presentation of your articles, stick with it; it's not too difficult to catch on to!


NerdBerry
NerdBerry@NerdBacon.com
The Cubist
TheCubist@NerdBacon.com
 
Issue #5.1 June 6th, 2015 Volume 1