Solution for Exercises on JQuery
- Assign font size and font family and background colour to a <p> tag by using style property.
- Use the above <p> tag in three places in a page and set this common style property to above tag.
- Use the above code to style the tags in multiple pages by using common file.
This is line 1
This is line 2
This is line 3
Code is here
Keep the style tag inside head tag of the page
<p id=p1 class=my_p>This is line 1</p>
<p id=p2 class=my_p>This is line 2</p>
<p id=p3 class=my_p>This is line 3</p>
To use the same style in multiple pages, use one external style page custom.css and place the link inside the head tag of all the pages.
Read more on CSS
<link rel='stylesheet' href='custom.css' type='text/css'>
This article is written by plus2net.com team.