HTML Renders With Display: None;

Discussion in 'HTML & Website Design' started by fireflyproject, Jul 15, 2008.

  1. #1
    For some odd reason, in FF2&3 some of my HTML is rendering with a display: none; property. This is NOWHERE in my css, or my HTML, so I don't know why this is happening.

    Here is the HTML.

    <div id="sidebar-ad">
    <p class="ad-image"><img src="images/ads/1.jpg" width="100" /></p>
    <p class="ad-text">Salon</p>
    <p class="ad-text">3343 S Halsted</p>
    <p class="ad-text">Chicago, IL 60608</p>
    <p class="ad-text">773-220-0000</p>
    <p class="ad-text">Slogan</p>
    </div>
    Code (markup):
    Here is the rendered HTML
    <div id="sidebar-ad">
    <p class="ad-image"><img width="100" src="images/ads/1.jpg" style="display: none;"/></p>
    <p class="ad-text">Salon</p>
    <p class="ad-text">3343 S Halsted</p>
    <p class="ad-text">Chicago, IL 60608</p>
    <p class="ad-text">773-220-0000</p>
    <p class="ad-text">Slogan</p>
    </div>
    Code (markup):
    As you can see, the <img> tag has the added style.

    If it helps, I'm using a simple while loop in PHP to create these. There are multiple instances of the DIV, however using just one instance does not change the fact of what happens.

    If you would like to see the PHP, here it is.

    while ($row = mysql_fetch_array($result)) {
    		if ($i<5) {
    			$ad = "<div id=\"sidebar-ad\">\n"
    					. "<p class=\"ad-image\"><img src=\"images/ads/" . $row['image'] . ".jpg\" width=\"100\" /></p>\n"
    					. "<p class=\"ad-text\">" .$row['name']. "</p>\n"
    					. "<p class=\"ad-text\">" .$row['address']. "</p>\n"
    					. "<p class=\"ad-text\">" .$row['city']. ", " . $row['state'] . " " . $row['zip']. "</p>\n"
    					. "<p class=\"ad-text\">" .$row['phone']. "</p>\n"
    					. "<p class=\"ad-text\">" .$row['slogan']. "</p>\n"
    				. "</div>\n\n";
    			
    			echo $ad;
    			$i++;
    		}
    	}
    PHP:
    I've done this a million times before, but have never seen this happen.

    This exact code was working a few days ago, but for some reason it's rendering differently now. I'm baffled.
     
    fireflyproject, Jul 15, 2008 IP
  2. Kirkbride

    Kirkbride Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is just a guess, but do you have some sort of ad blocking going on in Firefox? The image URL contains "ads" so I'm thinking maybe Firefox or a plugin is adding that inline CSS to hide it.
     
    Kirkbride, Jul 15, 2008 IP
  3. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #3
    Good sir, you deserve a trophy for catching a user error. Haha, of all the things that would have caused it. Damn you AdBlock!

    THANKS!
     
    fireflyproject, Jul 15, 2008 IP
  4. Kirkbride

    Kirkbride Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Happy to help:)
     
    Kirkbride, Jul 15, 2008 IP