dimanche 3 mai 2015

How to apply DRY to a series of HTML files that have an almost identical block?

I have a chain of pages that each contain this HTML

  <div class ="container">
    <h3>PROVIDER ENROLLMENT APPLICATION</h3>
  </div>

  <div class ="tabs">
     <a href="tabsA.html"><span>Sec A</span></a>
     <a href="tabsB.html"><span>Sec B</span></a>
     <a href="tabsC.html"><span>Sec C</span></a>
     <a href="tabsD.html"><span>Sec D</span></a>
     <a href="tabsE.html"><span>Sec E</span></a>
     <a href="tabsF.html"><span class="active">Sec F</span></a>
     <a href="tabsG.html"><span>Sec G</span></a>
     <a href="tabsH.html"><span>Sec H</span></a>
     <a href="tabsI.html"><span>Sec I</span></a>
     <a href="tabsJ.html"><span>Sec J</span></a>
     <a href="tabsK.html"><span>Sec K</span></a>
     <a href="tabsL.html"><span>Sec L</span></a>
     <a href="tabsM.html"><span>Sec M</span></a>
  </div

Excepting each page has only it's own href attribute displayed as "active", this being the page for tab F. Is there a way to have this block of code used only once activating the selected pages href attributes when selected?

Aucun commentaire:

Enregistrer un commentaire