Skip to content

Where I set out to demystify HTML

by John on January 31st, 2012

I’ve been around for awhile now . . . in fact, I just renewed, which means that I’ve been around for, at least a year1. One thing I’ve noticed, though, is that, among bloggers (well, around my group of bloggers, who are split evenly between mothers and want-to-be-parents and perverts and aspiring writers), there seems to be a very split camp for HTML. There are those that are comfortable with it, and there are those that get freaked-the-fuck-out whenever they have to look at HTML code.

Now, I should say that, in my day job, I deal with code, day-in and day-out. But, it’s rare that I actually work with HTML at its core2, at my job. When you’re writing computer code for the web, there are actually two sets of code that you care about. When your computer asks for a web page, you ask a web server for a specific page. That server will find the page & “read the code” on that page. Sometimes, that page is in HTML, and it just spits things back to you, the requester. Most of the time, though, the page is written in some other language, and the server figures out how to read that, and then sends you, the requester, the HTML the results from the server talking to the page. If your blog is a blog, you may have seen .PHP pages all about — if you look inside of those, you’ll see some pretty funky code. All that is doing is figuring out which HTML to send back to your readers.

However, HTML is the least of your worries. Sure, if you fuck up the HTML on your page, you can make it so that things just won’t work right. But, at the same time, if you fuck up the code that renders your page (see sidebar), you can take down your entire website, or the web server hosting your website.

But, if you know HTML . . . well, you can do whatever the heck you want to do with your blog . . . make things look exactly the way you want. All I’m going to do today, is explain what HTML is and how it works.

HTML stands for HyperText Markup Language, and it’s the language that dictates how a web page is to be interpreted by your web browser. Most of the “code” in a HTML page is just regular old text — the content that gets displayed. However, sometimes you want to send something special to the browser to make a word look different and that’s where HTML comes in.

HTML tags always start with a “less-than” symbol (<) and end with a “greater-than” symbol (>). I can tell you that the HTML tag for “bold” is just, b, so if we wanted to get some text displaying as bold, we’d start with <b> . . . but that’s only the start. Because we also need to tell the web browser where to end displaying the bold text, and, to do that, we repeat the tag, but we put the “forward-slash” (/) before it. So, if I wanted to write the word “bold” in bold in a post, the code would look like: <b>bold</b>.

Anytime we have something that should appear as anything besides “just regular text” on a blog post, we’ll need HTML4 to get that done. This means, anytime we want to include the following, we need to pull out HTML:

  • Bullet Points
  • Images
  • highlighted text
  • different text sizes
  • different fonts
  • links

Now, most of the time, we know where something will begin and where it something will end, as we’re writing it. For example, when I write a link (which is designated with the A tag in HTML, as A stands for anchor, and we want to anchor a piece of text so that, if you click on it, you’ll go somewhere else), I know the first character that I want to have as part of my link, and I know the last character that I want to have as part of my link. So, I know where to put my <a> and where to put my </a>

However, sometimes, like an image (which, in HTML, is an IMG tag), I just want the image on the page by itself . . . I don’t need to say “stop showing the image, dammit.” In this case, we put the forward-slash within the tag itself, to say “we don’t need a stop displaying the image“. So, if I wanted to include an image of my family, I would put all of the instructions into a single IMG tag, like tihs: <img src="" alt="Daddy Runs a Lot and Family" />.

But, well, there’s more to that than just the IMG tag . . . there are two attributes as well. Because, well, just saying “put an image here” isn’t enough . . . you need to tell the browser which image to display. So, when you have an image, you need to say “I’m putting an image here,” and then you need to say “and here is the source file for this image” (which is where the src) comes from. And, because I got my start designing web applications so that the blind could use them, I always place some “Alternate Text,” (the ALT attribute) to describe what’s in the image, in case my reader doesn’t have use of his or her eyes.

Here are some of the more-common HTML tags that you’ll use when blogging.

Tag Definition Example Notes
A Anchor (link somewhere) <a href=””>Daddy Runs a Lot</a> You need to use the href attribute here, so that you can say “this is where the person should go, after they click the link.” And, if you’re linking to another website, always be sure to include that “http://” at the beginning
B Bold <b>Daddy Runs a Lot</b>  
P Paragraph <p>Daddy Runs a Lot</p> This will put space above, and below, what you’re writing
BR Line Break Daddy Runs a Lot<br /> This will not place space above or below, but will just start the text you’re writing on the next line
IMG Image <img src=”×300.jpg” alt=”Daddy Runs a Lot and Family” /> You need the SRC attribute to say “this is where the image is stored.” The ALT attribute is optional, meaning that most web browsers won’t care if you leave it off
I Italic <i>Daddy Runs a Lot</i>  

Ok, so how do I accomplish my footnotes? I use a combination of tags. When I’m ready to put in a footnote, I start with the superscript tag, which is SUP. Then, I create a link using the hash symbol, which means “don’t link to another page, but I’m naming something on this page. Then, at the bottom of my page, I’m defining a section that links to the footnote. For example, I’m going to create my fifth footnote here, and the code will look like this:

<sup><a href="#footnote5">5</a></sup>5

And then, at the bottom of this page, I’ll use a division tag, DIV, which is a convenient way to say “I’m going to divide this page as a special section.” To this, I’ll add the ID attribute so that I can name it, and I’ll name it “footnote5” because that’s what I’m pointing to in the href=”#foonote5 attribute of my anchor tag above.

<div id="footnote5"><sup>5</sup> This is the fifth footnote<div>

1 I have no idea when I actually started blogging, because I stopped & restarted so many times.
2 Unless I’m writing here, where I just switch to the HTML editor and write away.3
3 Because I think and dream in HTML. And footnotes are WAY easier to write when you’re not switching between code and “not code.”
4 Some of you more-advanced readers will also probably think that you need CSS, which stands for Cascading Style Sheets, and you’d be right, but I don’t want to freak out my non-technical-readers any more than I absolutely have to right now
5 This is the fifth footnote.

From → Techie Tuesday

  1. KG (@Shoe_Mom) permalink

    And that sir, is one of the many reasons why I won’t blog. Yikes!!

    • I promise, it’s not all that bad . . . but, most bloggers just stick with MS Word-type interface and get their work done that way.

  2. your different fonts looks dangerously like Comic Sans.

    I’ve learned html while blogging but still don’t know what CSS. Care to demistify that in the future?

    • We’ll definitely get into CSS in the next few weeks — next week, I think, is nested HTML tags – then, we’ll head onto CSS.


        (yes, that needed ALLCAPS)

  3. LOLOL. I wont fit in!

    I’m not a Mom, I don’t particularly want to be a Mom right now, I am definitely NOT as aspiring writer. (I grew up with a Real Writer- no aspiring, I think once you have passed the 10 books published mark you are just a writer yep? and I dont want to be that!)
    And I am not a Pervert that I am aware of, though i did stare particularly lustfully at a photograph this morning, Of Pancakes, strawberries and whipped cream. In my defense, I just ran 10 miles….

    • That’s kind of cool about growing up with a writer . . . though I’d imagine it being difficult to want to write, when you grow up with it.

      I definitely left “runners” out of my readers, though . . .

  4. Cyndie permalink

    I have to admit that is all greek to me but I now have a reference to look back to as I move forward. Thank you

  5. I’m a novice and a bit of a sponge, so yay for this! I Stumbled it, too…

  6. LOVE this! But I suspect you knew I’d say that.

    So it’s not just me who thinks in code? I have the freakish tendancy to think about what I’d really like to say to someone when they ask me for help with something I know they can handle on their own. Except I see it in code in my freak brain. For example:

    …Sure I’ll help you out, since I have nothing else to do, you lazy mother-fu no problem.

    • I do the same thing, too – adding in the CSS to make things all-caps and larger, when I want to tell someone off.

  7. This actually helped me tonight, thanks!

  8. Yeah, I’m in the “FTFO” camp….

    I freak when it comes to this stuff….but when you are teaching it’s much easier to understand! 🙂

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS