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>

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.