Sharp Tutorial
How to apply CSS

Python

Java

C

C++

HTML/CSS

Java Script

PHP

SQL

C Programs

HTML

  • HTML Home
  • Introduction
  • HTML Element
  • Commonly used tags
  • Hyperlinks
  • Images in HTML
  • Div in HTML
  • Html Forms
  • Html Tables
  • Miscellaneous Topics

CSS

  • Introduction to CSS
  • How to apply CSS
  • CSS Selectors
  • Border in CSS
  • Text Formatting in CSS
  • Font Properties
  • Margin in CSS
  • CSS in List
  • CSS in Link
  • CSS Animation
  • CSS Effects
  • CSS Pagination
  • CSS Media Query

Java Script

  • Java Script Home
  • Introduction to Java Script
  • Variable in Java Script
  • Operators in Java Script
  • If-Else in Java Script
  • Loops in Java Script
  • Array in Java Script
  • Function in Java Script
  • Objects in Java Script
  • Java Script DOM

How to apply CSS

There are 3 types of CSS and different type CSS is applied in different way.

  1. Inline CSS-:Inline css is embedded within the element and it may not be reused .Inline css is applied to fix something directly without worrying about other elements or pages. <p style=“color:red”> so in above example style is embedded within  tag and color attributes changes the font color to red.
  2. Internal CSS-:Internal css is defined within the   Internal css may be reused within the page . Internal css is applied as following.
<!DOCTYPE>
<html>
<!--how internal css is embedded in a web page-->
<style>
h1
{
color:red; /* this attribute is applied on all h1 tag in this web page */
}
</style>
</head>
<body>
<h1>Heading with Red Color.</h1>
Hi i am not With red Color
<h1>I am also with red color.</h1>
</body>
</html>

Output of the above program is shown below

3.External CSS-: Using External CSS we can reuse the CSS throughout the website by writing the CSSin a different file with extension CSS.

The CSS file is being added into web pages wherever wee want to apply the impact of that CSS.

To use External CSS there are following two steps

  • Create a CSS file like following
    style.css->[code below]
    body{
    background-color:pink;}

    p
    {
    color:yellow;
    }

  • Create the web page where you want to apply this css attributes.
<html>
<head>
<style>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<p>Heading with Red Color.</p>
</body>
</html>

Enquiry about Course

Ask your Question

Click Here

Sharp (2) Tutorials

Video/ C Introduction

Watch video in full size

Video tutorial

Follow by Email
Facebook
Facebook
fb-share-icon
YouTube
Copyright © Sharp Tutorial
Build with WordPress
Wordpress Social Share Plugin powered by Ultimatelysocial
Sharp Tutorial