Every Tuesday in November I am showing you how to do one simple thing with HTML. Today it is how to put in a little line break. Like this –
The HTML code to do the line above looks like this –
Horizontal Rule
HR means Horizontal Rule – rule a horizontal line. ;) It really is that simple. But you can make it more complex if you want to. You can add a few things to it in order to make it look different, be shorter, be one dimensional. Here’s some of the extra codes you can use.
No Shade
NOSHADE means to be flat and one dimensional.
Size
Size obviously relates to the height of your horizontal rule. You can easily change the size of your horizontal rule by simply adding size=X – X being the number you want.
Width
There are two ways you can choose what width you want. Pixel size and percentage. I suggest to stick with percentage for the most part because it will automatically adjust itself accordingly.
Align
You cannot use align without using width. Center is probably the one you would use most. If you use width you may find that the HR centers itself automatically.
Color
So there you have it. The Horizontal Rule. Try one out in a post today!
Further Reading –
If you know nothing about HTML, this is where you start
Getting Started Tutorial
Learn Basic HTML For Your Website
Web Safe Color Chart
Non-dithering colors
How to Style an Unordered List with CSS
HTML Reference And Learning Websites –
HTML Code Tutorial
HTML Help
HTML Tutorials At W3
HTML Goodies
HTML Dog
Learn HTML And CSS
Wonderful…thanks! This is bookmarked!
Julie
Using My Words
Awesome – I used to know all these and have forgotten many of them – this is great that you’ll post them on Tuesdays! Love it! Now I don’t have to go searching through my books to find these! :) Thank you!
You show me things I did not realize existed. For example, today I am working on my Google reader…
Thanks so much for all the info – this will be prove to be VERY useful! I’m looking forward to next Tuesday’s post :)
snos–you are so smart–thanks for the great info!
Hm… I’d rather you concentrated on XHTML which is the future. HTML has largely been supplanted by XHTML and CSS, so you should write more on that.
Many of your tags use outdated HTML 4.0 attributes. For instance, instead of <HR color=”green”> It should be <hr style=”color:green;” /> and all tags should be compulsorily closed, according to XHTML (either using the shorthand <hr /> or <p> </p>. XHTML is much cleaner (note also that XHTML is case sensitive – it still works with browsers, because of backward compatibility, but all XHTML tags should be lower-case)
Here’s a place to start to learn about why XHTML is better: http://en.wikipedia.org/wiki/XHTML