Useful CSS Underline Tips and Tutorials

Useful CSS Underline Tips and Tutorials
Page content

CSS Underline

CSS underline is about as basic as it gets when it comes to web design and development. If you are completely new to web design, development, HTML, CSS, etc, this is what CSS underline does. Simple, right? The thing with CSS is, there are several different ways that you can implement it. You can use same page HTML and CSS, you can use a distinct stylesheet, you can use PHP, and so much more. This tutorial will teach you the basics of using the CSS underline style, and give some examples of how it can be used. Whether you are doing anything from underlining some text on your MySpace, to using external style sheets with your WordPress blog, this article should help you out.

Quick basics

Chances are, if you are reading this, you are probably quite new to working with CSS. So, some basics to get you started. CSS stands for cascading style sheet. CSS is a completely different thing than HTML. CSS is style only.

These { } are brackets. You will use them quite often when working with CSS.

Creating a direct CSS underline

In many cases, you can add direct CSS styling to text. This method of using CSS should be used for quick, basic, CSS underline styling. It cannot be done to just any text located just anywhere. The text must be HTML enabled. This is a good CSS underline method for quickly editing MySpace text sections.

To create direct CSS, we only need to use two tags, an opening tag and a closing tag. For CSS underline, the opening tag is: . The closing tag is . The tag initiates (starts) the underline point, and the tag stops the underline. For example:

This is a Bright Hub CSS Underline Tutorial will give you this: This is a Bright Hub CSS Tutorial

Only text within the tag elements will be underlined. For example:

I see a red door and I want to paint it black will give you this: I see a red door and I want to paint it black

Easy enough, right? That’s all there is to it. That’s how you do a direct CSS underline.

CSS Underline via External Stylesheet


In some circumstances, you will not want to use direct CSS underlining. One common example of this is a WordPress blog. With WordPress, you have a distinct stylesheet, which you call to action to be used throughout the theme. It would be stupid to use every time you needed to underline an element. For example, if you want all of your post titles underlined, you don’t want to have to add manually every time your write a post. This is where external style sheets come in handy. External style sheets allow you to specify certain html and add CSS style to it; in this case, the underline trait. Here’s how it works:

This is your WordPress post structure:


This is where my post titles go, I want all of this text to be underlined


#titleofposts {



This is the result:

This is where my post titles go, I want all of this text to be underlined


That’s all there is to it. CSS Underlining is very easy once you get the hang of it. If you want to learn more about CSS underline, I suggest you check out this website, as it features some great tutorials and has an editor where you can practice creating your own CSS.