What is the most semantic way of marking up a looping blocks?

Discussion in 'Programming' started by cosmicx, Jul 27, 2012.

to remove all ads.
  1. cosmicx

    cosmicx New Member

    Messages:
    23
    Hello Gurus,


    I am new to HTML/CSS, while learning I am already practicing and applying what I’ve been reading.

    And for now, I am developing a theme for a classifieds ads website.

    Now my question is, which is the better way of marking up a looping blocks?

    The looping blocks that I am referring to, is the block that contains the listing. The listing block holds the image for the listing, title, description and the name of the poster.

    I am deciding right now whether to used <div> blocks or using <ul> blocks.

    I thought of the <div> block like this:
    HTML:
    <div><!—block 1-->
    	<some more divs>
    </div>
    
    <div><!—block 2-->
    	<some more divs>
    </div>
    
    
    While I thought of the <ul> block like this:

    HTML:
    <ul>
         <li> 
              <div><!—block 1-->
                   <some more divs>
              </div>
         </li>
    
         <li> 
              <div><!—block 2-->
                   <some more divs>
              </div>
         </li>
    </ul>
    
    
    So, what do you guys think?
     
  2. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,662

Share This Page