Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Enumerate Products

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30786
    tiagoroldao
    Member

    Hi everyone.

    I trying to find the best way to enumerate products.

    In my page i have the products separeted by:

    (Product #1)
    (Product #2)
    (Product #3)
    (...)

    What i want is to add this code inside each div with ‘produto’ class:

    And var $number should increase with each div ($number +1) etc.

    What is the best way to do this? Thanks

    #72524
    Rob MacKay
    Participant

    Something like:


    $count = 1;

    while($count <= 10) { // while $count is less than or equal to 10.

    echo "
    $count
    ";

    $count++; // adds 1 to the count.

    }

    Hopefully this should give you an idea.

    #72504
    tiagoroldao
    Member

    Yes, thanks. But how can i add some code inside all divs with ‘producto’ class in page?

    :)

    #72489
    Rob MacKay
    Participant

    if it is already created you need to do it with Javascript.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.