html - CSS Table layout. Good way to accomplish this -


i wondering how can take css seriously. i'm clean developer css seems smell. want create layout extending thing made javascript. can show me solution in css how can accomplished. forget gradients , text color etc. maybe need in future take work credits.

enter image description here

<div class="faq">     <div class="faq-header">         <div class="help-title-label">questions , answers</div>     </div>     <div class="faq-entry">         <div class="faq-question">             <div class="faq-question-left">                 <div class="faq-question-state">+</div>             </div>             <div class="faq-question-right">                 <div class="faq-question-txt">my question text</div>             </div>         </div>         <div class="faq-answer">             <div class="faq-answer-left">                 <div class="faq-answer-title">a:</div>             </div>             <div class="faq-answer-right">                 <div class="faq-answer-txt">my question answer.</div>             </div>         </div>     </div>             <div class="faq-footer"></div> </div> 

in general agree vikingben. try avoid reinventing wheel.

if need make own accordion recommend using table html:

<table class="faq">     <thead>         <tr><th colspan="2">questions , answers</th></tr>     </thead>     <tbody>         <tr><th>-</th><td>my question text</td></tr>         <tr class="selected"><th>a:</th><td>my question answer.</td></tr>         <tr><th>+</th><td>my question text</td></tr>     </tbody> </table> 

you modeling tabular data here , table fine construct modeling tabular data. if use table css trivially easy. example.

if concerned you'll need change format later, restructure @ point. shouldn't fret on future html tag refactor unless think it's happen , effort spent upfront avoid worth it.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -