Forum Moderators: not2easy
I have a set of styles that puts a top border on a H4 element. I know IE doesn't put borders on inline elements but is there a way to force it? I heard if I change the display to 'block' it would work but it isn't for me.
The page in question is snip
View the same page in Mozilla or Netscape and you'll see certain header styles do appear bot will not appear in IE.
Please help!
Nathan
[edited by: SuzyUK at 8:36 am (utc) on Aug. 2, 2004]
[edit reason] ooops sorry no URLS see TOS #13 [webmasterworld.com] [/edit]
H4 is a block level element by default so adding display:block will not affect it.
The following code works in IE:
<style>
h4{
border-top: 1px solid #000;
}
</style>
<h4>This has a top border</h4>
Perhaps post some of the css you have for your h4...
(You will need to get rid of that link to your site- they're not allowed :) )
Does the following code do anything worthwhile?
<h4><span>Title Here</span><h4>
Do the span tags do anything? I mean the H4 is already an element so needing to span it so it can be styled is redundant. Could these span tags make the border style not show up in IE6?
I also use a background color but it also won't appear.
Here's a code snippet:
#wrapper #thirdTierContent h4 {
margin:0;
border-left:1px solid white;
padding-left:4px;
font-size:13px;
border-top:1px solid white;}
<h4><span>Phone Numbers</span></h4>
Any suggestions?
Nathan
make the border style not show up
#wrapper .thirdTierContent h4 { .....
Do the span tags do anything?
for instance you would put a background image onto the <h4> element and the use some method of hiding the <span> text, either using the visibility property or negative positioning so your image shows but the text value is not lost..
re: your question, background colors should show up on a span, and if you adjust the line-height or the display property of the span to make it "fit" the <h4> element the borders too should appear. The inline <span> won't accept height or width properties unless it is changed to display block..
I also use a background color but it also won't appear.
Change thirdTierContent from an id to a class.
e.g. this CSS example works fine.. background colors on both elements... try uncommenting either of the two <span> styles to see where the span (and it's borders) actually is....
h4 {
margin:0;
border-left:1px solid #000;
padding-left: 4px;
font-size: 13px;
border-top:1px solid #000;
background: #ccc;
}
h4 span {
border: 3px double #f00;
background: #ffc;
/* display: block; */
/* line-height: 30px; */
}
Suzy