css question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shyguy
    Confirmed User
    • May 2004
    • 123

    #1

    css question

    hiya ppl... i am using an image as a background in a table. but i want that image to not repeat itself when the table is stretched larger then its height... i was told i could fix this with css and i have looked around and read about it... but i cant find any straight forward answer for putting it into a table...

    help please!
    Great MONEY making opportunity - Casino Cash
  • Intrigue
    Confirmed User
    • Feb 2004
    • 662

    #2
    in the table tag, or wherever you have it, in the 'background' attribute you need to have no-repeat, so if your using a style attribute (inline css) you'd use style="background: no-repeat;" or just add no-repeat to your existing bcakground attribute if you have one already eg: 'background: url('/images/bg.gif');' becomes 'background: url('/images/bg.gif') no-repeat;'

    hope that clears it up for you.

    Comment

    • shyguy
      Confirmed User
      • May 2004
      • 123

      #3
      hey cheers,

      i changed this line to <td width="680" height="377" valign="top" background="images/bgbeta.jpg" style="background: no-repeat;" >

      but that made the bg dissappear?? could that be because i already have css style for my scroll bars defined at the top of my html? hence i have to then define everything up there now?

      im a bit new to all the css stuff...

      i also tried defining the background properties up the top, but im not sure that i was calling it correctly back down in the html where my table was...

      help please!
      Great MONEY making opportunity - Casino Cash

      Comment

      • MBS Auto
        Confirmed User
        • Oct 2004
        • 1725

        #4
        What size is the image and what size is the table??
        Shoes and Boot

        Comment

        • dexterlab
          Registered User
          • Aug 2004
          • 8

          #5
          See below for what you're trying to do.
          The path to the image can be relative or absolute if you're deploying in a war file or something to that effect. note the embedded DIV that inherits from the td class.
          Code:
          <html>
          <style>
          td.logo div {background-image: url(corner-black.gif); }
          </style>
          <body>
          <!-- the above style should read td dot logo div open curly then the rest of the line - it is getting munged when i post -->
          <table>
          <tr>
          <td class="logo"><div>Row 1, Cell 1</div></td><td>Row 1, Cell 2</td>
          </tr>
          <tr>
          <td>Row 2, Cell 1</td><td class="logo"><div>Row 2, Cell 2</div></td>
          </tr>
          </table>
          </body>
          </html>
          Last edited by dexterlab; 10-18-2004, 06:52 AM.

          Comment

          • shyguy
            Confirmed User
            • May 2004
            • 123

            #6
            cheers heaps for you help here dexterlab!

            i entered this into my css style section at the top:

            td.bglogo { background: url('images/bgbeta.jpg') no-repeat;}

            and then i just called the bglogo class like so:

            <td class=bglogo width= etc. etc.>

            as its just one table that i want it in... so does that seem correct? it seems to be working... i didnt include the div though... did i need to ?

            but i cant see it in dreamweaver, only when i actually preview it in a browser...

            ps. it seems that haha123; equals the left curly bracket...
            Last edited by shyguy; 10-20-2004, 06:03 PM.
            Great MONEY making opportunity - Casino Cash

            Comment

            Working...