I'm just curious what the CSS bug in IE is. I've never heard of one
that effects lists longer than 4 items only.
Also, you could run a counter inside of your loop and output the ul
and /ul tags on every fourth trip.
Javan
On Jan 29, 2007, at 5:39 PM, Kevin Burk wrote:
Working around Microsoft's utter lack of support for web standards,
I'm faced with needing a code hack so that the CSS that works in
every other browser will display correctly in IE on Windows.
The issue is with an iterated list: to make the code work in IE, I
have to limit each list to only 4 items. The challenge is that I
don't know how many items will be in a given list.
Normally, I would use this code:
<% object.features.each do |f| -%>
<ul class="css">
<li class="css-li"><%= f.name %></li>
</ul>
<% end %>
However, I now need to make sure that the output breaks the list at
4 items and then starts a new list:
<ul class="css">
<li class="css-li">Feature 1</li>
<li class="css-li">Feature 2</li>
<li class="css-li">Feature 3</li>
<li class="css-li">Feature 4</li>
</ul>
<ul class="css">
<li class="css-li">Feature 5</li>
<li class="css-li">Feature 6</li>
<li class="css-li">Feature 7</li>
<li class="css-li">Feature 8</li>
</ul>
<ul class="css">
<li class="css-li">Feature 9</li>
<li class="css-li">Feature 10</li>
</ul>
This is the only way that IE 6 for Windows will display the list
correctly. I'd rather not go back the CSS drawing board and attempt
to find a list style that IE will not choke on-but I have
absolutely no idea of how I would go about coding this in ruby. An
object can have any number of features, from 2 or 3 up to 20 to 25.
Since the list style creates button blocks, I would like to avoid
any empty blocks.
My first thought is that I'd have to pull all of the features into
an array, count the number of features, divide by 4 to get the
number of iteration blocks needed, and then generate all of the
block code from that (although I can just about figure out how to
create the array and count the items).
Is there a reasonably easy way to do this or should I give up and
just try to find a CSS hack instead? I'd love to simply refer IE
users to Firefox, but I don't think that would fly with my client.
Thanks in advance.
Kevin Burk
--
***************************************
BURK DESIGN GROUP
http://www.BurkDesignGroup.com
mailto:[EMAIL PROTECTED]
6161 El Cajon Blvd #306
San Diego, CA 92115
PHONE (619) 583-2311
FAX (619) 583-5801
***************************************
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby