Vote for BP.Net for the 2013 Forum of the Year! Click here for more info.

» Site Navigation

» Home
 > FAQ

» Online Users: 728

1 members and 727 guests
Most users ever online was 47,180, 07-16-2025 at 05:30 PM.

» Today's Birthdays

None

» Stats

Members: 75,899
Threads: 249,097
Posts: 2,572,069
Top Poster: JLC (31,651)
Welcome to our newest member, wkeith67
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    BPnet Veteran PythonWallace's Avatar
    Join Date
    02-26-2007
    Location
    Woodridge, IL
    Posts
    2,967
    Thanks
    204
    Thanked 346 Times in 210 Posts
    Images: 23

    Web gurus - HTML/CSS help

    I know there are a few members here who got this stuff down, so here goes. I have an image called logobkdg.jpg that I am trying to make a background image for a table, centered X and Y without repeating. If the code will replace the bkgd color I already have the table set at, it's 333333. Thanks in advance.
    What are these mojavas I keep hearing so much about?

    J. W. Exotics

    Reptile Incubators

  2. #2
    BPnet Lifer Nate's Avatar
    Join Date
    07-31-2004
    Location
    Northern Virginia
    Posts
    9,863
    Thanks
    127
    Thanked 625 Times in 386 Posts
    Images: 15

    Re: Web gurus - HTML/CSS help

    off the top of my head....
    Code:
    .tablebg{
    background-image: url(logobkdg.jpg);
    background-repeat: no-repeat;
    background-attachment:fixed;
    background-position:center;
    }
    
    <td class="tablebg">
    ...data...
    </td>
    I'm looking for other alternatives.

  3. #3
    BPnet Veteran ctrlfreq's Avatar
    Join Date
    07-21-2006
    Location
    Plano, TX
    Posts
    575
    Thanks
    3
    Thanked 44 Times in 31 Posts

    Re: Web gurus - HTML/CSS help

    Code:
    <table style="background: #333333 url('logobkdg.jpg') no-repeat center center;">
    or

    Code:
    (in stylesheet)
    
    table.classname {
    background: #333333 url('logobkdg.jpg') no-repeat center center;
    }
    
    (in code)
    <table class="classname">
    Of the two, the second is preferred, because the logo url is relative to the stylesheet, so you can have html files in any folder that refer to the class, and the image path will always be derived from the stylesheet path.

    The Earth is the cradle of mankind, but one cannot live in the cradle forever. -Konstantin Tsiolkovsky




  4. #4
    BPnet Lifer Nate's Avatar
    Join Date
    07-31-2004
    Location
    Northern Virginia
    Posts
    9,863
    Thanks
    127
    Thanked 625 Times in 386 Posts
    Images: 15

    Re: Web gurus - HTML/CSS help

    ctrlfreq, you need to have "fixed" somewhere in there, otherwise it centers horizontally in FireFox, not vertically.

    ctrlfreq's will do the same thing, it all depends on how you have your page set up.

    For instance, the way mine is set up, the CSS is either at the top of the web page or in an external CSS file.

    ctrlfreq has the style set up inline, which is perfectly acceptable.

    can you give us an idea of how your page is set up?

  5. #5
    BPnet Veteran PythonWallace's Avatar
    Join Date
    02-26-2007
    Location
    Woodridge, IL
    Posts
    2,967
    Thanks
    204
    Thanked 346 Times in 210 Posts
    Images: 23

    Re: Web gurus - HTML/CSS help

    Thanks guys! I tried the first one and it didn't screw anything up, but the image doesn't appear in the layout. Here is the new code. It's the table within the table I'm working with.

    <table width="922" height="458" border="2" cellpadding="4" cellspacing="8">
    <tr bgcolor="#000000">
    <td width="922" height="700" valign="top"><p><img src="top nav.jpg" width="920" height="139" /></p>
    <div align="center">
    <table style="background: #333333 url('logobkdg.jpg') no-repeat center center;">
    <tr>
    <td width="720" height="500" bordercolor="333333" bgcolor="333333">&nbsp;</td>
    </tr>
    </table>
    </div>
    <p>&nbsp;</p></td>
    </tr>
    </table>
    What did I do wrong?
    What are these mojavas I keep hearing so much about?

    J. W. Exotics

    Reptile Incubators

  6. #6
    BPnet Veteran Texas Dan's Avatar
    Join Date
    02-19-2008
    Location
    Dallas, TX
    Posts
    836
    Thanks
    12
    Thanked 24 Times in 16 Posts
    Images: 2

    Talking Re: Web gurus - HTML/CSS help

    Quote Originally Posted by PythonWallace View Post
    Thanks guys! I tried the first one and it didn't screw anything up, but the image doesn't appear in the layout. Here is the new code. It's the table within the table I'm working with.



    What did I do wrong?
    You can't just do what you did in the table, you have to do it in the header. That's not valid HTML code I don't think. I program a lot in php, I use dreamweaver to do all my HTML/CSS b* work.
    1.0.0 Normal BP: Vincent Vega

  7. #7
    BPnet Veteran PythonWallace's Avatar
    Join Date
    02-26-2007
    Location
    Woodridge, IL
    Posts
    2,967
    Thanks
    204
    Thanked 346 Times in 210 Posts
    Images: 23

    Re: Web gurus - HTML/CSS help

    Quote Originally Posted by nathanledet View Post
    ctrlfreq, you need to have "fixed" somewhere in there, otherwise it centers horizontally in FireFox, not vertically.

    ctrlfreq's will do the same thing, it all depends on how you have your page set up.

    For instance, the way mine is set up, the CSS is either at the top of the web page or in an external CSS file.

    ctrlfreq has the style set up inline, which is perfectly acceptable.

    can you give us an idea of how your page is set up?
    I'm making an index page, then I plan to edit the contents of this table only and saving them as all the pages of my site. I just started, so here is the entire code. I might be better off making a frameset instead of using the table. I just realized that I don't remember CSS, so I'm trying to stick with simple html. It's been a while I guess.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    color: 66cc66;
    }
    body {
    background-color: #666666;
    }
    -->
    </style></head>

    <body>
    <div align="center">
    <table width="922" height="458" border="2" cellpadding="4" cellspacing="8">
    <tr bgcolor="#000000">
    <td width="922" height="700" valign="top"><p><img src="top nav.jpg" width="920" height="139" /></p>
    <div align="center">
    <table style="background: #333333 url('logobkdg.jpg') no-repeat center center;">
    <tr>
    <td width="720" height="500" bordercolor="333333" bgcolor="333333">&nbsp;</td>
    </tr>
    </table>
    </div>
    <p>&nbsp;</p></td>
    </tr>
    </table>
    </div>
    </body>
    </html>
    What are these mojavas I keep hearing so much about?

    J. W. Exotics

    Reptile Incubators

  8. #8
    BPnet Lifer Nate's Avatar
    Join Date
    07-31-2004
    Location
    Northern Virginia
    Posts
    9,863
    Thanks
    127
    Thanked 625 Times in 386 Posts
    Images: 15

    Re: Web gurus - HTML/CSS help

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    color: 66cc66;
    }
    body {
    background-color: #666666;
    }
    .fixedbg{
    	 background-color: #333333;
    	 background-image: url(logobkdg.jpg);
    	 background-position:center;
    	 background-repeat: no-repeat;
    	 background-attachment:fixed;
    }
    -->
    </style></head>
    
    <body>
    <div align="center">
    <table width="922" height="458" border="2" cellpadding="4" cellspacing="8">
    <tr bgcolor="#000000">
    <td width="922" height="700" valign="top"><p><img src="top nav.jpg" width="920" height="139" /></p>
    <div align="center">
    <table class="fixedbg">
    <tr>
    <td width="720" height="500" bordercolor="333333" bgcolor="333333" class="fixedbg">&nbsp;</td>
    </tr>
    </table>
    </div>
    <p>&nbsp;</p></td>
    </tr>
    </table>
    </div>
    </body>
    </html>

  9. #9
    BPnet Lifer Nate's Avatar
    Join Date
    07-31-2004
    Location
    Northern Virginia
    Posts
    9,863
    Thanks
    127
    Thanked 625 Times in 386 Posts
    Images: 15

    Re: Web gurus - HTML/CSS help

    something is screwy there..sorry about that...

    <table>
    <tr class="fixedbg">
    <td width="720" height="500" bordercolor="333333" bgcolor="333333" >&nbsp;</td>
    </tr>
    </table>

    Not really sure why you can't put the class to table. It's been so long since i've messed with tables, i've forgotten.

  10. #10
    BPnet Veteran PythonWallace's Avatar
    Join Date
    02-26-2007
    Location
    Woodridge, IL
    Posts
    2,967
    Thanks
    204
    Thanked 346 Times in 210 Posts
    Images: 23

    Re: Web gurus - HTML/CSS help



    Thanks for taking the time to help me guys. I just realized that I typed the name of the image wrong. I've been working on this for 45 minutes, wondering why I couldn't get anything to happen. logobkgd.jpg, not logobkdg.jpg. When yours didn't work either I knew something was wrong.
    What are these mojavas I keep hearing so much about?

    J. W. Exotics

    Reptile Incubators

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.2.1