CSS Border Bottom Effect: <h1> vs Using A Class

F

Fred

Hello

<style type="text/css">
<!--
h1 {
margin-top: 0.8em;
margin-left: 28px;
margin-right: 2em;
font-size: 1.2em;
border-bottom-width: 2px;
border-bottom-color: #D7D7D7;
border-bottom-style: solid;
padding-bottom: 3px;
text-align: left;
}
-->
</style>


This style controls <h1> so that it looks like this...

http://mywebpages.comcast.net/surge42/h1style.htm

Is there a way to have this same exact effect by assigning a class
instead? For some reason the border-bottom line will not extend beyond
the text.
 
M

Mark Parnell

T

Toby Inkster

Fred said:
For some reason the border-bottom line will not extend beyond the text.

You are possibly trying to set the border on an inline element. Inline and
block elements behave differently with borders.
 
F

Fred

Let me ask it this way...

I'd like to achieve the same effect with out using <h1> at all.
Actually I'd like to apply the effect this way..

<span class="LineContinuesLikeitDoesWith_h1">
How would the CSS look in this situation?

The reason I'm asking is because I'm changing styles that are applied
to dynamically created HTML. And the classes are already defined.

There are no <h1>'s used...

I have no other choice but to apply the styles to <span>

thnx
 
F

Fred

You are possibly trying to set the border on an inline element. Inline and
block elements behave differently with borders.


I'm reading between the lines here and I think I'm screwed.
I'm going to have to start digging into the script (PERL) and change
it so that the printed html uses <h1> instead of <span>

I thought there might be a way to apply a special style to the
existing tag thats used <span>.

Thanks for the help guys
Fred
 
T

Toby Inkster

Fred said:
I thought there might be a way to apply a special style to the
existing tag thats used <span>.

There is. As others have said: "display:block".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top