Underline text with CSS

Author:Kostas Sp Published On:October 23, 2014 Under:UI

 
 

In this post I will show you a simple but an effective way to underline text with CSS

First the necesairy html code

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css" /> 
</head>
<body>
<p>This text will be underlined</p>
<span class="print_underline">&nbsp;</span>
</body>
</html>

The relevant css code is

span.print_underline
{
    display: inline-block;
    height: 1px;
    border-bottom: 1px solid #000;
	width:100%;
}

See a live fiddle here
http://jsfiddle.net/kostasp/y2qh7n91/

   
Tags:
 

Leave a Reply

Current day month [email protected] *


4 − = two

.
 
Categories
TEST

Anything in here will be replaced on browsers that support the canvas element

Tags