Monday, January 27, 2014

The Horizontal Rule

Hello! Today's short topic is on horizontal rules, as you can probably guess from the title! Horizontal rules are used to divide up the web page by splitting up the sections. I think that when I transfer this blog off, onto my own domain, I'll be using horizontal rules to divide my blog posts. Just a thought!

This is the way to add a horizontal rule (by default, it's a thin but solid, gray line across the screen):

<hr />

Pretty simple, right? If you haven't noticed, "hr" stands for horizontal rule... And as for the name "horizontal rule," well, the horizontal part is pretty straightforward. Think of rule as in a straight line ("metric ruler") instead of something you're supposed to follow.

Here's an example of a horizontal rule in HTML, in case you want more clarification:

<html>
<head>
    <title>Example of Horizontal Rule</title>
</head>
<body>
    <h1>Example of Horizontal Rule</h1>
    <hr />
    <h2>A Section</h2>
    <p>The content/stuff for this section</p>
    <hr />
    <h2>Another Section!</h2>
    <hr />
    <h2>And Another Section!</h2>
    <hr />
    <h2>And Another Section!</h2>
    <hr />
    <h2>And Another Section!</h2>
    <hr />
    <h2>And Another Section!</h2>
</body>
</html>
       
And this is what it looks like!












I know; I went a bit overboard with the sections... Oh well! Maybe now you super ooper get it!

No comments:

Post a Comment