Welcome Guest! (App Version 3.1)

websitnero logo name

Adding CSS to HTML Page

Overview

  • There are 3 ways of adding CSS - Inline, Internal & External.
  • CSS changes the look & feel of entire HTML Page and its contents.
  • CSS does not play any part in functional behavior of a Web Page.

Adding CSS to an HTML Page

While HTML only adds the basic skeleton of a web page, CSS is used to add properties to the various HTML tags and make the page look beautiful.

There are 3 ways of adding CSS styles to a web page which are as follows:

  • Adding Inline Styles
  • Adding Internal Styles
  • Adding External Styles

<p style="color:red;font-size:20px;">This is a paragraph.</p>

<sytle>
  p {color:red; font-size:20px;}
</style>

<link rel="stylesheet" href="someStyle.css"/>

Inline styling is done within the element tags. As the elements, which are viewable to the end user, are present in the body section of the web page so inline styles are added directly inside their tags.

Internal styles can be added to either head section or body section of a web page with the help of <style> tags.

Similarly, external style sheets can be added to either head section or body section (mostly at the end of the content or to the bottom of the body section) of a web page.

WebsiteNero is highly optimized for learning various website developing technlogies. We try our best to add maximum modules and examples to help learn the concepts clearly and vividly. We try to present all content and examples as simple as we can removing any complexity to hurdle easy understanding. We try best provide you with worthful content, but we cannot guarantee full correctness of all the content on this site. While using this website, you agree to have read and accepted all our terms of use and conditions, cookie, and privacy policy. Copyright, 2013-2018 by websitenero.com. All Rights Reserved.