Skip to main content

HTML & CSS

 





HTML & CSS:

                CSS Stands for “Cascading Style Sheet”. It was introduced in late 1996.

            CSS saves a lot of work and time.

With CSS, you can control the color, font, the size of text, the spacing between elements,  what background images or background colors are to be used, different displays for different devices and screen sizes, how elements are positioned and laid out, and much more!

 It is used to control the layout of various

            Web pages all at once.

Types of CSS:

            There are three types of the style sheet

1.      Inline styling

2.      Internal styling

3.      External styling

Inline Styling:

                An inline CSS is used to apply a style to a single HTML element.

An inline CSS uses the "style" attribute of an HTML element.

 

Example:

                Following are some examples of inline CSS.

1.         <h1 style="color:red;">A Red Heading</h1>

2.         <p style="color:green;">A Green paragraph.</p>

Internal Styling:

               

An internal CSS is defined in the <head> section of an HTML page, within a <style> element. Used to apply a style for a single HTML page.

Example:

The following example sets the text color of ALL the <h1> elements (on that page) to “silver” and the text color of ALL the <p> elements to red. In addition, the page will be displayed with a "powderBlue"

<html>

<head>

<style>

body {background-color: powderblue;}

h1   {color: selver;}

p    {color: red;}

</style>

</head>

<body>

 

<h1>This is a heading</h1>

<p>This is a paragraph.</p>

 

</body>

</html>

External Styling:

            An external style sheet is defined in a separate file saved with “.css” extension.

            To use an external style sheet, add a link to it in the <head> section of each HTML page by using <link> tag.

It is useful when the style is applied to many web pages

Example:

           

 

<html>

<head>

                        <link rel=”stylesheet” type=”text/css” href=”mystyle.css”>

</head>

<body>

 

<h1>This is a heading</h1>

<p>This is a paragraph.</p>

 

</body>

</html>

 

The file must not contain any HTML code and must be saved with a .css extension.

The external style sheet can be written in any text editor.

 

The "styles.css" file looks like:

 

"styles.css":

 

body {

 

  background-color: silver;

}

h1 {

  color: red;

}

p {

  color: blue;

}

Comments

Popular posts from this blog

Computer Graphics and image processing Mathematical Background

 Computer Graphics and image processing Mathematical  Background Numerical Background  1.1 Introduction  The instructed material in this course draws upon a numerical foundation in direct polynomial math.  We momentarily update a portion of the fundamentals here, prior to starting the course material in Chapter 2.  1.2 Points, Vectors, and Notation  Quite a bit of Computer Graphics includes conversation of focuses in 2D or 3D. Normally we compose such  focuses as Cartesian Coordinates for example p = [x, y]  T or q = [x, y, z]  T  . Point organizes are  accordingly vector amounts, instead of a solitary number for example 3 which we call a scalar  amount. In these notes, we compose vectors in striking and underlined once. Grids are composed  in striking, twofold underlined.  The superscript [...]  T indicates rendering of a vector, so focuses p and q are segmented vectors  (organizes stacked on top of ea...

Features of Operating System

 Features of Operating System All application like games, MS office, Firefox requires a reasonable climate to execute and play out their assignment. The working framework assists the client with associating with the framework without knowing to chip away at the coding languages. It isn't plausible for anybody to utilize any cell phones or PCs without conveying the working framework. It is compulsory to have at any rate one working framework to execute the projects and play out the assignment. So in the straightforward, working framework is characterized as the product that goes about as a line between PC equipment and end-client for simple collaboration to finish the assignment viably.  Highlights of Operating System  There is a wide scope of outstanding highlights in the working framework which is creating step by step. The development of OS is splendid in light of the fact that it is created in 1950 to deal with the capacity tapes and now it was functioning as an interf...

HTML Headings

  Headings: Heading are used to display different type of headings. “<Hn>” is the opening tag of headings and the closing tag is “</Hn>” where “n” is the size of the heading. Its value is from 1 to 6 . 1 represents the largest size and 6 represents the smallest size. HTML headings are titles or captions that you need to show on a site page . Example: compose and html code that show the heading on a page           <HTML>           <BODY> <h1> Heading      2 </h1> < h2 > Heading 2 < /h2 > < h3 > Heading 3 < /h3 > < h4 > Heading 4 < /h4 > < h5 > Heading 5 < /h5 > < h6 > Heading 6 < /h6 > </HTML>           </BODY> Save file with “heading.html” Double click the file. The page will open as follows...