dongnong3019
2014-02-12 23:17
浏览 26
已采纳

使PHP适应CSS手风琴

I'm having trouble setting up the Div structure in my PHP to fit into a checkbox CSS Accordion. I don't actually know if it is possible

//Here is my PHP

echo '<div class="accordion"><div class="section">';
    echo '<div class="section-head">';
        echo '<div class="header-lable">'.$field[label].'</div>';
        echo '<div class="rating-letter">'.$image_text.'</div>';
    echo '</div>';

    echo '<div class="editor-content">'.$value.'</div>';
echo '</div></div>';

The accordion I'm trying to get it into is here" http://bradsknutson.com/blog/css-only-accordion/

The DIV structure it requires is this:
<div class="container">
<div class="accordion">
<div>
            <input id="ac-1" name="accordion-1" type="checkbox" />
            <label for="ac-1">About</label>
<div class="article ac-small">
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. 
</div>
</div>
<div>

Any help with formatting this this would be hugely appreciated.

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dopii22884 2014-02-13 02:51
    已采纳

    i'm not sure i get what you're trying to do... but you can tweak the php output to this and get pretty close. basically merging both pieces of code

    echo '<div class="container">';
    echo '<div class="accordion"><div class="section-head">';
            echo '<input class="header-label" id="'.$field[label].'" name="accordion-1" type="checkbox" />';
            echo '<label class="rating-letter" for="'.$field[label].'">'.$image_text.'</label>';
            echo '<div class="editor-content article ac-small">'.$value.'</div>';
    echo '</div></div>';
    echo '</div>';
    
    打赏 评论

相关推荐 更多相似问题