Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Firefox not displaying image - Joomla

    Hi there,

    I customized the content module so the title of an article displays an image before the text and the text is displayed with two colors!!

    The relevant part of the code is at follows:
    Code:
    <h2 class="title">
    			<?php if ($params->get('link_titles') && !empty($this->item->readmore_link)) : ?>
    			<a href="<?php echo $this->item->readmore_link; ?>">
    				<div><span class="image-title"></span>
    				<?php 
    				$titles = explode(" ",$this->item->title);
     
    					for ($i=0; $i<count($titles)-1; $i++){
    						echo '<div style="float:left;padding-left:7px;color:#303030;">'.$this->escape($titles[$i]).'</div>';
     
    					}?> 
    					<div style="color:#06cfef;float:left;padding-left:7px;"><?php echo $this->escape($titles[$i]);?></div></div></a>
    					<div style="clear:both;height:0px;"></div>
    			<?php else : ?>
    				<div><span class="image-title"></span>
    				<?php
    					$titles = explode(" ",$this->item->title);
    					for ($i=0; $i<count($titles)-1; $i++){
    						echo '<div style="float:left;padding-left:7px;">'.$this->escape($titles[$i]).'</div>';
     
    					}?> 
    					<div style="color:#06cfef;float:left;padding-left:7px;"><?php echo $this->escape($titles[$i]);?></div></div>
    					<div style="clear:both;"></div>
    			<?php endif; ?>
    		</h2>
    In both IE and Google Chrome everything is displayed as wanted (apart from ie which has some positioning problem but i'm not focusing on that now)

    In firefox, I can see the content loading correctly but just before the page finish loading the image disappears... I just can't understand why!!

    You can take a look at this url: http://sostudent.com/joomla/

    Can anyone please help??

    Thanks

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Code:
    <h2 class="title">
    <a href="/joomla/">
    				<div><span class="image-title"></span>
    				<div style="float:left;padding-left:7px;color:#303030;">Business</div> 
    					<div style="color:#06cfef;float:left;padding-left:7px;">ABC</div></div>
    </a>
    
    					<div style="clear:both;height:0px;"></div>
    					</h2>
    That's clearly an invalid markup, as you can't nest a block level element like <div> inside an inline element like <a>.

    See http://validator.w3.org/check?verbos...om%2Fjoomla%2F
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •