Welcome to WebmasterWorld Guest from 54.234.8.146

Forum Moderators: incrediBILL

Message Too Old, No Replies

tiling background img in a 1px height table without any text for NS

     

sophie

4:04 pm on Oct 17, 2001 (gmt 0)

10+ Year Member



in IE, it is pretty easy to get it.

in NS4, how can i have a tiling background img in a 1px height table without any text? that drives me crazy! the img is a 10px long and 1px high.

if i put   in TD, the img will be too high. height attribute seems not work. need a compatible way for both IE and NS.

<table>
<TR>
<TD COLSPAN=4 width=100% height=1px bgcolor="#ffcc00" background="images/styles/yellow_line.gif">
</TD>
</TR>
</table>

sophie

4:12 pm on Oct 17, 2001 (gmt 0)

10+ Year Member



i tried to put a 1px img in TD. but it still doesn't have the right 1px height in NS.

even just bgcolor is acceptable.

sophie

5:34 pm on Oct 17, 2001 (gmt 0)

10+ Year Member



it is solved by finding out the previous posts.

thanks. it is such a good forum.

gethan

8:31 pm on Oct 17, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello Sophie - welcome to Webmaster World - yep its a great forum.

Glad to hear you solved the buglet. I was just about to try a few things out ;)

Was the answer simple?

My guess was height='1' and a 1x1 tansparent gif in the cell, and bgcolor with no background gif.

sophie

3:36 pm on Oct 18, 2001 (gmt 0)

10+ Year Member



hi, gethan,

it is pretty simple. made a 1x1px img and insert <img src="" height=1 width=700> into the td tag. td just keeps the same bgcolor.

i am hoping to find a better one where 100% relative width can be used. it doesn't apply to the above situation.

mivox

5:49 pm on Oct 18, 2001 (gmt 0)

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



If you use a 1x1 transparent gif, set the bgcolor for the table cell, and set the table/cell width to 100%, the 1x1 gif should "hold" the cell height at 1px, and the bg color would (of course) expand with the table width.

sophie

6:37 pm on Oct 22, 2001 (gmt 0)

10+ Year Member



i tried it before, but NS4.08 always give me a much wider bar. are you sure it applys to NS4? if so , i will try again.

mivox

6:52 pm on Oct 22, 2001 (gmt 0)

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



As I recall, it always worked for me...

I never used the 1x1 gif as a "background" image for the <td> tag though... I always set it up as:

<TD height="1" bgcolor="#000000"><img src="http//url.to/clear-pixel.gif" width="1" height="1"></td>

Maybe that's the catch for NN 4?

sophie

7:15 pm on Oct 22, 2001 (gmt 0)

10+ Year Member



thank you mivox! it works!

the format i used to have was:

<td>
<img>
</td>

after i copy and paste your code in one line, it works! never noticed that the format of code have impact on layout.

mivox

7:24 pm on Oct 22, 2001 (gmt 0)

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



With Netscape, I've noticed that line breaks in the code can have some very strange effects on spacing... usually extra vertical space ends up in places you don't want it.

Glad it worked! I haven't used a 1px gif in a while, so I wasn't sure if I remembered correctly... :)

 

Featured Threads

Hot Threads This Week

Hot Threads This Month