HTML help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jon

    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



  • Todd Cary

    #2
    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$113 81$cc9e4d1f@new s.dial.pipex.co m> in
    > comp.infosystem s.www.authoring.html, Jon <news@jonelliso n.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]

    Comment

    • Headless

      #3
      Re: HTML help

      "Jon" <news@jonelliso n.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]




      Headless

      Comment

      • Jane Withnolastname

        #4
        Re: HTML help

        On Sun, 27 Jul 2003 15:33:14 +0100, "Jon" <news@jonelliso n.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)....

        Comment

        • EightNineThree

          #5
          Re: HTML help


          "Jane Withnolastname" <JaneWithnolast nameNOSPAM@yaho o.com> wrote in message
          news:0vb3jvc18c b05kis6fdk4hrda la5raat78@4ax.c om...[color=blue]
          > On Sun, 27 Jul 2003 15:33:14 +0100, "Jon" <news@jonelliso n.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.


          Comment

          • Jane Withnolastname

            #6
            Re: HTML help

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

            Normally I wouldn't, but this person wasn't being helped.

            Comment

            • Lauri Raittila

              #7
              Re: HTML help

              In article <ijs3jvof4o74hb p8adrhds0t9i0kt t6apc@4ax.com>, Jane
              Withnolastname wrote:[color=blue]
              > On Wed, 6 Aug 2003 22:14:42 -0400, "EightNineThree "
              > <eightninethree @REMOVEeightnin ethree.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

              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;bac kground:#000;wi dth:100%;}
              span {float:right;he ight:2px;backgr ound:#ccc;width :190px;}
              </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.

              Comment

              Working...