Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

background function not supported in Firefox

Options
  • 26-04-2007 8:02pm
    #1
    Closed Accounts Posts: 1,974 ✭✭✭


    Hi there, I have the following code in my HTML page, IE is rendering it fine, but Firefox not. Firefox is overlapping the text and my page is actually compressed in a couple of lines.

    My code
    <TD WIDTH=16 HEIGHT=313 background="images/right_px.jpg" valign="top"><img src="images/spacer.gif"></TD>
    
    

    Basically "background="images/right_px.jpg", Firefox does not like at all.

    Do you guys know what should be the proper code to work either on IE and Firefox ?

    Thank a lot in advance

    Mick


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    The fact that you have the width set to 16 pixels probably isn't helping.

    Also, CSS over "spacer images" any day, thanks.


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Really depends on what the problem is that you're seeing. At the very least, using some CSS for this would solve a lot of your heartache.

    Particularly when plugging images in, the browsers can do odd things.


  • Closed Accounts Posts: 1,974 ✭✭✭mick.fr


    Hi,

    As I was saying, background="images is not supported by Firefox, what should be the good function to use ?

    Thanks


  • Registered Users Posts: 3,594 ✭✭✭forbairt


    mick.fr wrote:
    Hi,

    As I was saying, background="images is not supported by Firefox, what should be the good function to use ?

    Thanks

    like the other guys said ...

    function dontUserBackgroundImagesInTables() {

    Investigate CSS designs ... spacer images shouldn't really be used. Table layouts / designs for the most part are a no no ... also a nightmare to change

    }

    you could give the table cell an ID

    #tableCellName {
    width: 16px;
    height: 314px;
    background-image: url('image');
    }

    or something similar ?


  • Registered Users Posts: 2,031 ✭✭✭colm_c


    The background property isn't supported in anything other than IE - because it's not actually a property, it's one MS made up. Same as the 'height' attribute.

    To put a background on a table use the following:

    [HTML]
    <table style="background: url(images/background.gif) top left;">
    [/HTML]

    I would however try to use CSS instead of tables for layout, best practice these days.


  • Advertisement
  • Closed Accounts Posts: 1,974 ✭✭✭mick.fr


    Alright thanks for your input guys


  • Closed Accounts Posts: 831 ✭✭✭Laslo


    mick.fr wrote:
    As I was saying, background="images is not supported by Firefox, what should be the good function to use ?

    :eek: How flippant. Listen to what people are saying mate. Learn to code HTML properly.


  • Registered Users Posts: 2,919 ✭✭✭Bob the Builder


    Css is the only job to take you out of that hole
    Laslo wrote:
    :eek: How flippant. Listen to what people are saying mate. Learn to code HTML properly.
    ...Or learn css, and you shall never have to see a table ever again*. It's a c_nt to learn but you'll regret it if you dont...

    * Unless it's your table in the kitchen, or your putting in some tabular data.


  • Closed Accounts Posts: 104 ✭✭H3LLg0d


    <style type="text/css">
    body
    {
    background-image:
    url('whatever.gif')
    }
    </style>


  • Registered Users Posts: 895 ✭✭✭brav


    nevf wrote:
    Css is the only job to take you out of that hole...Or learn css, and you shall never have to see a table ever again*. It's a c_nt to learn but you'll regret it if you dont...

    Sorry, I know I'm not a webmaster but how does CSS remove the need for tables?
    Are you talking about using absolute to position everything?
    I've used div tags but I've never messed with CSS much, edited a few but never created

    I thought the benefit CSS was so you can just edit the template and it will change the design for the whole site and not just edit every page.

    I have a bit of reading to do...


    EDIT: I've just read a few guides (like this one) and I suppose it does help with the div tags ant the relative positioning etc, much better than using messy tables.


  • Advertisement
  • Registered Users Posts: 2,157 ✭✭✭Serbian


    brav wrote:
    Are you talking about using absolute to position everything?
    I've used div tags but I've never messed with CSS much, edited a few but never created

    You should look into CSS a bit more. You don't absolutely position divs, generally, you float them to provide the structure to your site. In many ways they are a lot more flexible than tables and can generally achieve the same layout in far less code (meaning smaller file size).

    Here is a good introduction as to why using CSS is good:

    http://www.hotdesign.com/seybold/

    And if you still want to use that table-like layout, here's a way to do it with <div>s:

    http://snook.ca/archives/html_and_css/getting_your_di/


Advertisement