0
What is CSS? Explain the ways by which CSS is included in the web page.

Mumbai University > information technology > sem 4> Web Programming

Marks: 10M

Year : May16

0  upvotes
0

CSS:

  • CSS stands for Cascading Style Sheets

  • CSS describes how HTML elements are to be displayed on screen, paper, or in other media

  • CSS saves a lot of work. It can control the layout of multiple web pages all at once

  • External stylesheets are stored in CSS files

  • CSS is used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes.

CSS Solved a Big Problem

HTML was NEVER intended to contain tags for formatting a web page!

HTML was created to describe the content of a web page, like:

<h1>This is a heading</h1>

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

When tags like <font>, and color attributes were added to the HTML 3.2 specification, it started a nightmare for web developers. Development of large websites, where fonts and color information were added to every single page, became a long and expensive process.

To solve this problem, the World Wide Web Consortium (W3C) created CSS.

CSS removed the style formatting from the HTML page!

CSS can be added to HTML elements in 3 ways:

  • Inline - by using the style attribute in HTML elements

  • Internal - by using a <style> element in the <head> section

  • External - by using an external CSS file

1. Inline CSS:

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

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

  • This example sets the text color of the

    element to blue:

enter image description here

2. Internal CSS:

  • An internal CSS is used to define a style for a single HTML page.

  • An internal CSS is defined in the <head> section of an HTML page, within a <style> element:

enter image description here

3. External CSS

  • An external style sheet is used to define the style for many HTML pages.

  • With an external style sheet, you can change the look of an entire web site, by changing one file!

  • To use an external style sheet, add a link to it in the <head> section of the HTML page:

enter image description here

0  upvotes
Please log in to add an answer.

Next up

Read More Questions

If you are looking for answer to specific questions, you can search them here. We'll find the best answer for you.

Search

Study Full Subject

If you are looking for good study material, you can checkout our subjects. Hundreds of important topics are covered in them.

Know More