Welcome to WebmasterWorld Guest from 50.17.74.162

Forum Moderators: not2easy

Message Too Old, No Replies

<h1> in CSS

     

jckos

8:17 pm on Feb 7, 2003 (gmt 0)

10+ Year Member



For search engine purposes, I'm trying to use an <h1> tag at the top of a page, but it gives me an unwanted line break that misalligns the text with a related image.

I want the image and text to line up like a nav image button and asasociated text.

Is there anyway to eliminate the break in the <h1> tags through CSS?

Thanks

Macguru

8:23 pm on Feb 7, 2003 (gmt 0)

WebmasterWorld Senior Member macguru is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Hi jckos,
I found this interesting thread in the forum's library [webmasterworld.com].

[webmasterworld.com...]

jckos

8:42 pm on Feb 7, 2003 (gmt 0)

10+ Year Member



I tried that and still no luck, at least in IE 6.

Any other help out there?

Nick_W

8:45 pm on Feb 7, 2003 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Can you post a simplified and very short code snippet?

Nick

jckos

8:59 pm on Feb 7, 2003 (gmt 0)

10+ Year Member



<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#999999">
<tr nowrap cellspacing="0">
<td bgcolor="#999999" align="left"><img src="image.gif" height="22" width="17" border="0"></td>
<td><a href="mylink.html" title="title"><img src="image2.gif" height="16" width="16" border="0" alt="alt text"></a>&nbsp;<a href="mylink.html" title="Alt text"><h1>Click Here</h1></a></td>
</tr>
</table>

From the css file:

h1 {
font-size: 12 px;
border: 1px solid red;
margin: 0;
padding: 0;
}

I tried margin-bottom: 0 and padding-bottom: 0

choster

9:01 pm on Feb 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried setting
display:inline
?

jckos

9:05 pm on Feb 7, 2003 (gmt 0)

10+ Year Member



I hadn't but I tried and it fixed it!

Never seen that tag before. Is it cross browser compaitble?

Thanks for the heads up.

DrDoc

9:13 pm on Feb 7, 2003 (gmt 0)

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member



My 2 ..

Put the link inbetween the <h1> tags .. not vice versa the way you have it now. Headings are block-level elements, anchors are inline-level elements. Block-level elements are not supposed to be located within an inline-level element .. (validation stuff) :)

jckos

9:21 pm on Feb 7, 2003 (gmt 0)

10+ Year Member



Thanks