1 reply [Last post]
estrata
Offline
newbie
Last seen: 11 years 35 weeks ago
Timezone: GMT-6
Joined: 2006-01-28
Posts: 3
Points: 2

I thought I fixed this, but it's started going crazy again.

Basically, I coded my friend's portfolio using ModX and CSS. But when it loads the blocks, sometimes there is a blank one. It's much easier to just see as opposed to my trying to explain: http://www.erinkong.com/index.php?id=47.

Here is the code that loads each individual block:
<div class="galleryblock"><a href="[~[+id+]~]"><img src="[+image+]" width="175" height="130" border="0" /><br />[+pagetitle+]</a></div>

And here is the css for the div class:

.galleryblock {
	display: inline;
	width: 200px;
	float: left;
	position: relative;
	text-align: center;
	padding-top: 20px;
	vertical-align: top;
}

I thought I had fixed this. Gahhh!

Thank you!

-Laura

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 5 years 11 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

The CSS3 solution would be to

The CSS3 solution would be to use
.galleryblock:nth-child(3n+1) { clear: left; }
You could also do a count in the PHP to give every fourth element a class and use that to clear with

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph