Blackboard

Background images in Firefox

rated by 0 users
Not Answered This post has 0 verified answers | 1 Reply | 1 Follower

Not Ranked
Male
2 Posts
Carl Reynolds posted on 14 Nov 2011 2:21 PM

I have created a content item with a <div> that spans the entire width of the item, and has a background image set with CSS:

<div style="
    width:100%;
    height:700px;
    text-align:center;
    padding-top:100px;
    background-image:url(absolute-path-to-my-image.jpg);
    ">

This works great in IE, but when I view it in Firefox (ver. 7.0.1) the background image is gone. I've tried using a table instead of a div, and doubled up on the background property, but that doesn't help:

<table background="absolute-path-to-my-image.jpg"
    width="100%" height="700" align="center"
    style="
    width:100%;
    height:700px;
    text-align:center;
    padding-top:100px;
    background-image:url(absolute-path-to-my-image.jpg);
    ">
    <tr>
        <td background="absolute-path-to-my-image.jpg"
               width="100%" height="700" align="center"
               style="
               width:100%;
               height:700px;
               text-align:center;
              padding-top:100px;
              background-image:url(absolute-path-to-my-image.jpg);">

This doesn't help either. Something I've noticed is that when I edit the item in FF, it inserts an HTML quote character (&quote;) before and after the image path in the style properties:

style="background-image:url(&quote;absolute-path-to-my-image.jpg&quote;);">

Doesn't do that in IE - not sure if it has any bearing...

Thanks,

joe

All Replies

Not Ranked
Male
2 Posts

OK, the saga continues...

I tried replacing the original background image with a smaller one (400 x 321px), and it worked in both IE and FF. Then I reduced the size of the original BG image (it was 1920 x 900, reduced it to 1000 x 900), and it stopped working in FF. Replaced the image again with the smaller, 400 x 321 image, but now it won't display in FF - exact code and image that worked before :(

Tried inserting a style block at the top of the code:

<style type="text/css">
table {background-image:url(https://blackboard2.dcccd.edu/sessions/1/0/3/1/8/1/2/2/session/9989c3c123de4c6fb7181c850f3959fc/machu%20picchu.jpg);}
td {background-image:url(https://blackboard2.dcccd.edu/sessions/1/0/3/1/8/1/2/2/session/9989c3c123de4c6fb7181c850f3959fc/machu%20picchu.jpg);}
</style>

Also tried:

<style type="text/css">
table {background-image:url(https://blackboard2.dcccd.edu/sessions/1/0/3/1/8/1/2/2/session/9989c3c123de4c6fb7181c850f3959fc/machu%20picchu.jpg);}
table td {background-image:url(https://blackboard2.dcccd.edu/sessions/1/0/3/1/8/1/2/2/session/9989c3c123de4c6fb7181c850f3959fc/machu%20picchu.jpg);}
</style>

In both cases the style was stripped out, leaving only:

<style type="text/css"></style>

at the top of the code.

Don't know if that helps, or just muddies the water :)

Page 1 of 1 (2 items) | RSS