css3 - Multiple pages CSS - Different styles in each page for same elements -


i want elements on 1 page styled , not affect same elements on page.

i have class="homepage" on each element.

is there better way it?

for simplicity, here div on page.

h1.homepage, p.homepage, li.homepage {    margin-left: 200px;  }  p.homepage, li.homepage {    font-size: 20px;  }   
<div>      <h1 class="homepage">angular 2 typescript beginners</h1>      <br>       <p class="homepage">this project teaches single page applications (spa) , how build them.</p>      <p class="homepage">this real-world application. single page application 2 pages.</p>      <ul class="homepage">          <li class="homepage">page 1 - list of customers restful api crud operations.</li>          <li class="homepage">page 2 - list of posts restful api pagination , search opeartions master/detail views</li>      </ul>      <br>            <p class="homepage">angular 2 next big thing. it's 1 of leading frameworks building modern, scalable, cross-platform apps.</p>      <p class="homepage">it’s leading framework building javascript heavy applications. used in building single page applications (spa). in standard web app, when click on link, entire page reloaded. in spa, instead of reloading entire page, replace view in content area view. keeps track of history if user navigates using , forward buttons, reinsert application in right state. fast , fluid experience. gmail example of spa.</p>            <br>        <p class="homepage">typescript superset of javascript, meaning valid javascript code valid typescript. typescript brings many useful features javascript missing in current version of javascript. classes, modules, interfaces, properties, constructors, access modifiers (e.g. public/private), intellisense , compile-time checking. so, can catch many programming errors @ compile-time.      </p>      <p class="homepage">angular 2 written in typescript. plus, of documentation in typescript. , reason, typescript dominant language in building angular 2 apps.      </p>  </div>

there better alternative.

surround page class , use descendant selectors:

.homepage h1, .homepage p, .homepage li  {    margin-left: 200px;  }    .homepage p, .homepage li  {    font-size: 20px;  }   
<div class="homepage">      <h1>angular 2 typescript beginners</h1>      <br>       <p>this project teaches single page applications (spa) , how build them.</p>      <p>this real-world application. single page application 2 pages.</p>      <ul >          <li>page 1 - list of customers restful api crud operations.</li>          <li>page 2 - list of posts restful api pagination , search opeartions master/detail views</li>      </ul>      <br>            <p>angular 2 next big thing. it's 1 of leading frameworks building modern, scalable, cross-platform apps.</p>      <p>it’s leading framework building javascript heavy applications. used in building single page applications (spa). in standard web app, when click on link, entire page reloaded. in spa, instead of reloading entire page, replace view in content area view. keeps track of history if user navigates using , forward buttons, reinsert application in right state. fast , fluid experience. gmail example of spa.</p>            <br>        <p>typescript superset of javascript, meaning valid javascript code valid typescript. typescript brings many useful features javascript missing in current version of javascript. classes, modules, interfaces, properties, constructors, access modifiers (e.g. public/private), intellisense , compile-time checking. so, can catch many programming errors @ compile-time.      </p>      <p>angular 2 written in typescript. plus, of documentation in typescript. , reason, typescript dominant language in building angular 2 apps.      </p>  </div>


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -