Submit Your Article Forum Rules

Results 1 to 6 of 6

Thread: Using background images only once in a cell

  1. #1

    Using background images only once in a cell

    On my home page, on the left hand navigation cell, I want to have that background image displayed only once so that it will fade to color #D5D5FF. Instead, as you can see, it is repeating the image. How can I get this image to display only once so that I get that fade effect?

    Thanks for your help,
    Alex

  2. #2
    WebProWorld MVP
    Join Date
    Sep 2003
    Posts
    1,156

    Try this:

    Probably the easiest way would be to imbed another table.

    Change this:
    Code:
    <td width="15%" valign="top" height="100%" style="border-style: solid; border-width: 1" bgcolor="#D5D5FF" background="menu_d00dle.jpg">
            
              <p align="center">[img]images/nav_icf_home.gif[/img]</p>
              <p align="center"><a href="icf_store/">
              [img]images/nav_icf_store.gif[/img]</a></p>
              <p align="center"><a href="photo_gallery/">
              [img]images/nav_pht_glry.gif[/img]</a></p>
    
              <p align="center"><a href="uses/">
              [img]images/nav_uses_ideas.gif[/img]</a></p>
              <p align="center"><a href="contact/">
              [img]images/nav_contact_us.gif[/img]</a></p>
           
              <p align="center"><a href="aboutus/index.html">
              [img]images/nav_about_us.gif[/img]</a></p>
           
            </td>
    To this:
    Code:
    <td>
      		<table background="menu_d00dle.jpg" style="border-style: solid; border-width: 1">
      			<tr>
      				<td>        
    		          <p align="center">[img]images/nav_icf_home.gif[/img]</p>
    		          <p align="center"><a href="icf_store/">
    		          [img]images/nav_icf_store.gif[/img]</a></p>
    		          <p align="center"><a href="photo_gallery/">
    		          [img]images/nav_pht_glry.gif[/img]</a></p>
    		
    		          <p align="center"><a href="uses/">
    		          [img]images/nav_uses_ideas.gif[/img]</a></p>
    		          <p align="center"><a href="contact/">
    		          [img]images/nav_contact_us.gif[/img]</a></p>
    		       
    		          <p align="center"><a href="aboutus/index.html">
    		          [img]images/nav_about_us.gif[/img]</a></p>       
            		</td>
    			</tr>
    		</table>
    	</td>
    I think that should do it. Hope that was what you were looking for.

  3. #3
    Senior Member
    Join Date
    Mar 2004
    Posts
    101

    thats bad advice....

    Probably the easiest way would be to imbed another table.
    could not disagree more.

    the best way to do this is to add to the CSS.

    change this:

    style="border-style: solid; border-width: 1" bgcolor="#D5D5FF" background="menu_d00dle.jpg"

    to:

    style="background-image:url(menu_d00dle.jpg); background-repeat:no-repeat; background-color:#D5D5FF; border:1px solid #000000;"


    note make sure you remove the bgcolor and background= from the html, as the css will take care of this now.

    good luck
    ben

  4. #4
    Senior Member eightfifteen's Avatar
    Join Date
    Jan 2004
    Posts
    406
    benihana -

    The problem with the CSS solution is that not all browsers will read that. Many older browsers don't recognize that code at all.

  5. #5
    WebProWorld MVP
    Join Date
    Sep 2003
    Posts
    1,156

    Re: thats bad advice....

    Quote Originally Posted by benihana
    Probably the easiest way would be to imbed another table.
    could not disagree more.
    Really? You would have disagreed less if I told him that he could do it by putting a slice of cheese in his CD Rom? Just kiddin...

    Both good points from benihana and eightfifteen.

  6. #6

    THANKS!!

    Quote Originally Posted by benihana
    Probably the easiest way would be to imbed another table.
    could not disagree more.

    the best way to do this is to add to the CSS.

    change this:

    style="border-style: solid; border-width: 1" bgcolor="#D5D5FF" background="menu_d00dle.jpg"

    to:

    style="background-image:url(menu_d00dle.jpg); background-repeat:no-repeat; background-color:#D5D5FF; border:1px solid #000000;"


    note make sure you remove the bgcolor and background= from the html, as the css will take care of this now.

    good luck
    ben
    OHMANOHMANOHMAN WOW
    Thanks so much Ben. I really like the way it looks now. Just have to tweak the image so it fades more gradually.

    Alex

Similar Threads

  1. How to use Photoshop Sliced images as a background?
    By cg0404 in forum Graphics & Design Discussion Forum
    Replies: 6
    Last Post: 03-22-2010, 11:13 PM
  2. Why use background images?
    By frobn in forum Accessibility and Usability Forum
    Replies: 11
    Last Post: 03-04-2008, 04:09 PM
  3. Background images -- tag them ?
    By killerbeame in forum Search Engine Optimization Forum
    Replies: 4
    Last Post: 11-17-2006, 03:05 PM
  4. Stationary Background images?
    By ackerley1 in forum Graphics & Design Discussion Forum
    Replies: 1
    Last Post: 11-24-2005, 05:21 PM
  5. Background images in table cells?
    By ScottG in forum Graphics & Design Discussion Forum
    Replies: 2
    Last Post: 06-25-2004, 10:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •