Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 04:20 PM
Jon
Guest
 
Posts: n/a
Default HTML help

Hi, I'm pretty good normally with HTML, but for some reason I'm blind as to
why the following code doesn't work:

<html>
<head>
<body topmargin=0 marginheight=0 leftmargin=0>
<table cellpadding=0 cellspacing=0 width=100% border=0>
<tr height=2>
<td bgcolor=black width=100% height=2>
</td>
<td bgcolor=#666666 height=2>
<img src="spacer.gif" width=190 height=2>
</td>
</tr>
</table>
</html>


I simply want a 2 pixel high bar across the screen with the last 190 pixels
being grey and the rest black. spacer.gif is a 1x1 pixel transparent gif.

Instead of being 2 pixels high, it is (I think) 18 pixels high, and I can't
seem to find any way of making it smaller.

Cheers



  #2  
Old July 20th, 2005, 04:20 PM
Todd Cary
Guest
 
Posts: n/a
Default Re: HTML help

Stan -

Could you share a better way to do this? Trying to learn...

Todd

Stan Brown wrote:[color=blue]
> In article <3f23e2d3$0$11381$cc9e4d1f@news.dial.pipex.com> in
> comp.infosystems.www.authoring.html, Jon <news@jonellison.co.uk>
> wrote:
>[color=green]
>>Hi, I'm pretty good normally with HTML, but for some reason I'm blind as to
>>why the following code doesn't work:
>>
>><html>
>><head>
>><body topmargin=0 marginheight=0 leftmargin=0>
>><table cellpadding=0 cellspacing=0 width=100% border=0>
>><tr height=2>
>> <td bgcolor=black width=100% height=2>
>> </td>
>> <td bgcolor=#666666 height=2>
>> <img src="spacer.gif" width=190 height=2>
>> </td>
>></tr>
>></table>
>></html>
>>
>>
>>I simply want a 2 pixel high bar across the screen with the last 190 pixels
>>being grey and the rest black. spacer.gif is a 1x1 pixel transparent gif.
>>
>>Instead of being 2 pixels high, it is (I think) 18 pixels high, and I can't
>>seem to find any way of making it smaller.[/color]
>
>
> Just a guess really, but I rather suspect the spaces you have before
> and after your image are your problem. A space is a normal
> character, which means that it has a height of one line, which is
> certainly more than 2 pixels on pretty much any GUI.
>
> Which spaces do I mean? Consider the difference between
> <td>
> <img>
> </td>
> and
> <td><img></td>
> (all attributes omitted for clarity)
>
>
> P.S. You will get plenty of responses from people telling you that
> there are better ways to do what you're trying to do. For the
> record, I agree.
>[/color]

  #3  
Old July 20th, 2005, 04:20 PM
Headless
Guest
 
Posts: n/a
Default Re: HTML help

"Jon" <news@jonellison.co.uk> wrote:
[color=blue]
>I simply want a 2 pixel high bar across the screen with the last 190 pixels
>being grey and the rest black. spacer.gif is a 1x1 pixel transparent gif.[/color]

http://www.headless.dna.ie/test/jons_hr.htm


Headless

  #4  
Old July 20th, 2005, 04:25 PM
Jane Withnolastname
Guest
 
Posts: n/a
Default Re: HTML help

On Sun, 27 Jul 2003 15:33:14 +0100, "Jon" <news@jonellison.co.uk>
wrote:
[color=blue]
>Hi, I'm pretty good normally with HTML, but for some reason I'm blind as to
>why the following code doesn't work:
>
><html>
><head>
><body topmargin=0 marginheight=0 leftmargin=0>
><table cellpadding=0 cellspacing=0 width=100% border=0>
> <tr height=2>
> <td bgcolor=black width=100% height=2>
> </td>
> <td bgcolor=#666666 height=2>
> <img src="spacer.gif" width=190 height=2>
> </td>
> </tr>
></table>
></html>
>
>
>I simply want a 2 pixel high bar across the screen with the last 190 pixels
>being grey and the rest black. spacer.gif is a 1x1 pixel transparent gif.
>
>Instead of being 2 pixels high, it is (I think) 18 pixels high, and I can't
>seem to find any way of making it smaller.
>
>Cheers[/color]

I don't think you can what you want inside a table.
I don't think there is a height attribute for TR or TD. If there is,
it is reading it as text height, rather than pixel height. You could
try writing the height as "2px" (quotes required)....
  #5  
Old July 20th, 2005, 04:25 PM
EightNineThree
Guest
 
Posts: n/a
Default Re: HTML help


"Jane Withnolastname" <JaneWithnolastnameNOSPAM@yahoo.com> wrote in message
news:0vb3jvc18cb05kis6fdk4hrdala5raat78@4ax.com...[color=blue]
> On Sun, 27 Jul 2003 15:33:14 +0100, "Jon" <news@jonellison.co.uk>
> wrote:
>[color=green]
> >Hi, I'm pretty good normally with HTML, but for some reason I'm blind as[/color][/color]
to[color=blue][color=green]
> >why the following code doesn't work:
> >
> ><html>
> ><head>
> ><body topmargin=0 marginheight=0 leftmargin=0>
> ><table cellpadding=0 cellspacing=0 width=100% border=0>
> > <tr height=2>
> > <td bgcolor=black width=100% height=2>
> > </td>
> > <td bgcolor=#666666 height=2>
> > <img src="spacer.gif" width=190 height=2>
> > </td>
> > </tr>
> ></table>
> ></html>
> >
> >
> >I simply want a 2 pixel high bar across the screen with the last 190[/color][/color]
pixels[color=blue][color=green]
> >being grey and the rest black. spacer.gif is a 1x1 pixel transparent[/color][/color]
gif.[color=blue][color=green]
> >
> >Instead of being 2 pixels high, it is (I think) 18 pixels high, and I[/color][/color]
can't[color=blue][color=green]
> >seem to find any way of making it smaller.
> >
> >Cheers[/color]
>
> I don't think you can what you want inside a table.
> I don't think there is a height attribute for TR or TD. If there is,
> it is reading it as text height, rather than pixel height. You could
> try writing the height as "2px" (quotes required)....[/color]

Please don't give anymore advice.


--
Karl Core

Charles Sweeney says my sig is fine as it is.


  #6  
Old July 20th, 2005, 04:25 PM
Jane Withnolastname
Guest
 
Posts: n/a
Default Re: HTML help

On Wed, 6 Aug 2003 22:14:42 -0400, "EightNineThree"
<eightninethree@REMOVEeightninethree.com> wrote:
[color=blue]
>Please don't give anymore advice.[/color]

Normally I wouldn't, but this person wasn't being helped.
  #7  
Old July 20th, 2005, 04:25 PM
Lauri Raittila
Guest
 
Posts: n/a
Default Re: HTML help

In article <ijs3jvof4o74hbp8adrhds0t9i0ktt6apc@4ax.com>, Jane
Withnolastname wrote:[color=blue]
> On Wed, 6 Aug 2003 22:14:42 -0400, "EightNineThree"
> <eightninethree@REMOVEeightninethree.com> wrote:
>[color=green]
> >Please don't give anymore advice.[/color]
>
> Normally I wouldn't, but this person wasn't being helped.[/color]

I think he was helped, maybe not all the way though. (it seems to be
simple white space bug, it would be strange if no one had noticed it.)

But your reply had not a single correct sentence:
[color=blue]
> I don't think you can what you want inside a table.[/color]

That is possible. Not that it should be done, as there is better ways,
which I think were mentioned. Why tell someone how to shoot her foot?
[color=blue]
> I don't think there is a height attribute for TR or TD. If there is,
> it is reading it as text height, rather than pixel height.[/color]

There is for td
http://www.w3.org/TR/html4/struct/ta...adef-height-TH
Of course it is deprecated. And of course it is pixel height. There is no
such thing as "text height" in HTML AFAIK.
[color=blue]
> You could try writing the height as "2px" (quotes required)....[/color]

That would be incorrect. And if it was correct HTML, quotes wouldn't be
required.

Anyway, here is something valid with CSS and meaningless markup:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<title>HR</title>
<style type="text/css">
div {height:2px;background:#000;width:100%;}
span {float:right;height:2px;background:#ccc;width:190p x;}
</style>
<div><span></span></div>

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles