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

» Site Navigation

» Home
 > FAQ

» Online Users: 740

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

» Today's Birthdays

None

» Stats

Members: 75,905
Threads: 249,102
Posts: 2,572,091
Top Poster: JLC (31,651)
Welcome to our newest member, Pattyhud

Web gurus - HTML/CSS help

Printable View

  • 03-19-2008, 03:26 PM
    PythonWallace
    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.
  • 03-19-2008, 03:31 PM
    Nate
    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.
  • 03-19-2008, 03:40 PM
    ctrlfreq
    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.
  • 03-19-2008, 03:44 PM
    Nate
    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?
  • 03-19-2008, 03:47 PM
    PythonWallace
    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.

    Quote:

    <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?
  • 03-19-2008, 03:50 PM
    Texas Dan
    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.
  • 03-19-2008, 03:53 PM
    PythonWallace
    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.
    Quote:

    <!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>
  • 03-19-2008, 04:03 PM
    Nate
    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>

  • 03-19-2008, 04:09 PM
    Nate
    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.
  • 03-19-2008, 04:13 PM
    PythonWallace
    Re: Web gurus - HTML/CSS help
    :bow::bow:

    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. :rolleye2:
Powered by vBadvanced CMPS v4.2.1