View Single Post
Old 12-05-2007, 12:17 PM   #1 (permalink)
xixao
New Hunter
 

Join Date: Dec 2007
Posts: 1
iTrader: 0 / 0%
Hunter Bux: 0
xixao is on a distinguished road
Question Alternating dt/dd?

Hi everyone,

I've been searching everywhere for an answer, but have yet to find one. My problem is this:

I'm drawing news feeds dynamically on a client's site using iframes. The feeds come through as a definition list (dl), with the article titles as dt's, and their source as dd's. I've been able to alter the appearance of the list in a way that resembles a table, using the following:

PHP Code:
dl.i_rss {
    
width:95%;
    
margin:5px auto;
    
border:1px solid #ADBED6;
    
}
    
dl.i_rss dt {
        
padding:10px 5px 5px 5px;
        }
        
dl.i_rss dt a {
            
text-decoration:none;
            
font-size:12px;
            
font-weight:bold;
            }
    
dl.i_rss dd {
        
border-bottom:1px solid #ADBED6;
        
margin-left:0;
        
padding:5px 5px 10px 5px;
        }
        
dl.i_rss dd a {
            
text-decoration:none;
            
color:#999;
            
padding-right:15px;
            }
            
dl.i_rss dd a:hover color:#333; } 
A request has been made to have alternating rows in this "pseudo-table", so I need to somehow target every other dt and associated dd, and give it a different background color. There are no unique classes or other identifiers passed, so I'm unsure how to do this. The standard table row i%2 technique isn't working...

Here is how the list is coming through:

PHP Code:
<dl class="i_rss">
    <
dt class="rss_title">...</dt>
    <
dd class="rss_home">...</dd>
    <
dt class="rss_title">...</dt>
    <
dd class="rss_home">...</dd>
    <
dt class="rss_title">...</dt>
    <
dd class="rss_home">...</dd>
</
dl
Any suggestions?
xixao is offline   Reply With Quote