How to Add Inline Styles to HTML Elements
You can style individual HTML elements by applying inline styles and we will demonstrate how to do that in this tutorial.
You can apply inline CSS styles to individual HTML elements on your web page. Inline styles are used to give style to specific elements that do not share the same style with other elements on your website. Like external style sheets and internal style sheets, inline styles are also a valid type of defining the style and layout of a web page (HTML document).
The following example shows how inline styles are applied to some common HTML elements:
<title>My Web Page</title>
<p style="font-weight: bold">This is a paragraph with bold text.</p>
<p><a href="portfolio.html" style="color: blue"/>This is a blue link.</a></p>
Inline styles should be avoided if multiple elements on multiple pages are styled in the same way, because using inline styles in that case will add unnecessary clutter of code. If you are styling multiple elements on the same page in the same way, simply use internal style sheets; if you are styling multiple elements on multiple pages in the same way, simply use external style sheets.
More CSS Tips
How to Add Internal Style Sheets (CSS) to a Web Page How to Add Comments in CSS How to Add External Style Sheets (CSS) to a Web Page Introduction to CSS Two Things You Should Know Before You Start Working with CSS A Great Free Resource for CSS Beginners Designing a Simple Testimonial Box with CSS Double Underline and Double Overline Text with CSS 7 Things to Avoid in CSS for Browser Compatibility Simple CSS Table Tutorial: Create a Colorful Table with CSSCSS Tips