Hilfe durchsuchen

Vorsicht vor Support-Betrug: Wir fordern Sie niemals auf, eine Telefonnummer anzurufen, eine SMS an eine Telefonnummer zu senden oder persönliche Daten preiszugeben. Bitte melden Sie verdächtige Aktivitäten über die Funktion „Missbrauch melden“.

Learn More

Background-images won't display when css display is "none" and program template changes display to "block" or any other visible display, e.g., "inline."

  • Keine Antworten
  • 1 hat dieses Problem
  • 8 Aufrufe
more options

I am running a game program with templates linked to css for display. With Javascript, I change divs, tables, &c., from display:none to, e.g., display:block. All the attributes work EXCEPT the background image. So, for example, if background color is #000000, the background shows solid black, and if I change that ahead of time or even on the fly to, e.g., #FF0000, the background changes onclick to solid red. But, the background image appears pretty much at random as the computer pleases. So, for example, the background-image is set by css for a table where display:none is the setting. The template changes the table to display:inline-block. The table appears, the background color appears, but often no background image appears UNLESS I open the console and uncheck, then recheck some property, e.g., height, associated with the background image. If, however, I set the initial table property to, e.g., display:inline, the initial result shows a bunch of garbage, but once the display is switched to inline-block, all the background images appear normally and regularly. This appears to be some kind of bug with Firefox, but for the life of me, I cannot fix it. If the display of an element -- article, div, table -- starts in the css as "none," the background image often does not appear when display is switched on.

I am running a game program with templates linked to css for display. With Javascript, I change divs, tables, &c., from display:none to, e.g., display:block. All the attributes work EXCEPT the background image. So, for example, if background color is #000000, the background shows solid black, and if I change that ahead of time or even on the fly to, e.g., #FF0000, the background changes onclick to solid red. But, the background image appears pretty much at random as the computer pleases. So, for example, the background-image is set by css for a table where display:none is the setting. The template changes the table to display:inline-block. The table appears, the background color appears, but often no background image appears UNLESS I open the console and uncheck, then recheck some property, e.g., height, associated with the background image. If, however, I set the initial table property to, e.g., display:inline, the initial result shows a bunch of garbage, but once the display is switched to inline-block, all the background images appear normally and regularly. This appears to be some kind of bug with Firefox, but for the life of me, I cannot fix it. If the display of an element -- article, div, table -- starts in the css as "none," the background image often does not appear when display is switched on.