dimanche 12 avril 2015

Same div class with different css styles

I am using wordpress and I have div whose classname is "page" on three different pages. Three pages slugs are 1. home 2. aboutus and 3. contactus.


I want the width of page class div on aboutus page to be different but I don't want to access the page html directly I mean supposing I only have the option of jquery to be enqueued and add some new id or class on about us page with variable width. So how can it be done. Below is the code for three pages


on home page



<div class="page">

</div>


on about us page



<div class="page">

</div>


on contactus page



<div class="page">

</div>


CSS



div.page {width:1000px; height:auto;}


I don't want to manually change the html but want to use jquery to append some new class and define different width for about us page.


Thanks everybody.


1 commentaire: