Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a div tag heading with a underline?

Tags:

css

See Wikipedia http://en.wikipedia.org/wiki/Css

If you look at the heading, it says "Cascading Style Sheets", then it has an underline.

How do you do that?

.heading1 {
/* heading with underline */
}
like image 616
001 Avatar asked Jun 11 '10 10:06

001


People also ask

How do you underline a div?

To underline text in div using JavaScript, get reference to the div element, and assign element. style. textDecoration property with value of "underline" .

How do you underline a heading in HTML?

HTML <u> Tag.

How do you underline a header in CSS?

How to Underline a Title in CSS. To underline a title, you can use text-decoration: underline; but you can make it prettier if you use the border-bottom property. In the latter case, however, you need to add display: inline; so that the underline wouldn't be longer than the word itself.


2 Answers

just add in the css: text-decoration: underline;

like image 37
David Avatar answered Nov 06 '22 18:11

David


Use borders:

.heading1 {
    border-bottom: 1px solid #aaa;
}

And if you're using Firefox, get Firebug which allows you to inspect any element's CSS attributes so you don't have to guess how a certain style is implemented.

like image 172
Tatu Ulmanen Avatar answered Nov 06 '22 18:11

Tatu Ulmanen