-1

I have some text which I want underlined. Now, I don't just want the actual text to underline, I want the line to stretch across the screen.

I do:

H4{align:left; font-style: bold; border-bottom: 1px black solid;}

However, I don't want the line to run the entire width of the screen. I only want it to be say 750px wide or a percentage of the screen. I try:

H4{align:left; font-style: bold; border-bottom: 1px black solid; width:750px;} 

But this does not work. The line still runs the entire width of the page. Any tips?

dublintech
  • 16,815
  • 29
  • 84
  • 115

2 Answers2

0

use a <hr />

then in the css:

hr{
    width: 75%;
    border: solid #DDD;
    border-width: 1px 0 0;
    clear: both;
    margin: 10px 0 30px;
    height: 0;
    margin-left: auto;
    margin-right: auto;
}
Idrizi.A
  • 9,819
  • 11
  • 47
  • 88
joshuahornby10
  • 4,222
  • 8
  • 36
  • 52
0

I suspect that you have some other CSS that is overriding your definition. For example, your CSS does function as expected: http://jsfiddle.net/pvjvA/1/

h4 {
  text-align:left; 
  font-style: bold; 
  border-bottom: 1px black solid; 
  width:750px;
} 
BenM
  • 52,573
  • 26
  • 113
  • 168