Welcome Guest! (App Version 3.1)

websitnero logo name

What is CSS?

Overview

  • In 3 ways you can add CSS to a web page - Inline, Internal & External.
  • !important has highest priority in case of CSS conflict.

Definition of CSS

CSS stands for Cascading Style Sheets. It is not a language but rather a method to beautify html pages without much hassle. CSS is the power of beautification that is implied on to simple HTML elements. Black and White combination of simple texts can be converted to beatiful eye-catching items. It is not wrong to say that if HTML is father of Web Designing, CSS is the mother of it. With the help of CSS files we can very easily control and customize the height, width, color, background, or any other attribute or property of an HTML element.

While HTML will only set the basic layout or skeleton of a webpage, CSS will add the various traits of backgrounds, colors, opacity, dimensions, font-family, font-size, text-styling, position, and many more. It is not be wrong to say that html only creates a basic sketch, but CSS adds life to it.

How to add CSS styles to your Web Page?

There are three ways to add CSS Styles to your web page:

  • Inline Styling - This is the simplest way to add styles to html elements. Here we adds styles directly to an html element.
  • Internal Styling - In this method we add the styles in the head section of a webpage using the <style> tags.
  • External Style Sheets - This is by far the best and most used method to add styles to a web page. In this method we add all the styles required for an application or a web page to a separate .css file and then reference this file in the head section of the web page.

Priority of Style Sheets

Inline styles have highest priority, followed by internal style sheets, followed by external style sheets. This means, if there is a conflict in style properties for an element, then the least priority would be given to the style written in external style sheet, while the highest priority would be given to inline style for that element.

!important keyword

Though the rule mentioned above holds true in normal cases, but there is an exception to this rule. The master of all is !important keyword. This keyword provides a Veto to the rule given above. Hence applying !important to some styling written in external style sheet would overrule the inline styling for that element.

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.