Jump to content

Strange Layout (Ignoring then Reading DIV Close)


justlukeyou

Recommended Posts

I've now my site set up but I have strange uneven echo of columns into DIVs which isn't coming out as other designs I have used. 

 

My Limit is 3 so I am only echoing 3 articles but they are coming out uneven. 

 

For some reason the "discussionarticlescontentborder" does not close (with the </DIV>) on the first echo but then on the second echo it does.  But then on the third echo it doesn't close.

 

So only the second article is laid out properly.

 

What I dont understand is why it ignores, then followers, then ignores the DIV closure on "discussionarticlestitleborder".

 

Does anyone have any ideas why it may ignore but then follow the DIV closure.  I have similiar layouts all over the site but this one behaves differently.

 

 

<div id="discussionsarticlescell">

<?php
$query = mysql_query("SELECT * FROM articles ORDER BY ID DESC LIMIT 3");
while($row = mysql_fetch_array($query)) {
    ?>

<div class="discussionarticlestitleborder"><a href="/articles/article/<?php echo $row['ID']; ?>" class='articleslink' rel="nofollow" ><?php echo $row['title']; ?></a></div>



<div class="discussionarticlescontentborder"><?php echo substr($row['articleintro'], 0, 200); ?></div>

<div class="discussionarticlesimageborder"><a href="/articles/article/<?php echo $row['ID']; ?>" rel="nofollow" ><img src="<?php echo $row['image'];?>" /></a></div>


<?php
}

?>

</div>

Hi,

 

I've worked out what it is.  Its this part here...

 

<?php echo substr($row['articleintro'], 0, 200); ?>

 

For some reason this part messing up the echo outlay in the DIVs

 

If I just echo it like this it works fine but I want limit it to 200 characters.

 

<?php echo $row['articleintro']; ?>

 

Any ideas please?

Its around 1000 characters which is limited by the MySQL set tup.  I could use 'article' intro which unlimited.  I am trying to constrain either of these just to echo only 200 character of either of these.

 

When I use substr as above it messing up the CSS.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.