web development basics introduction to css

14
WEB DEVELOPMENT BASICS BY KALLURI VINAY REDDY 12MSE1013 VIT CHENNAI

Upload: kalluri-vinay-reddy

Post on 06-May-2015

263 views

Category:

Education


0 download

Tags:

DESCRIPTION

this ppt brings an idea about the cascading styling sheets and their linking advantage to html file

TRANSCRIPT

Page 1: Web development basics introduction to css

WEB DEVELOPMENT BASICS

BY

KALLURI VINAY REDDY

12MSE1013

VIT CHENNAI

Page 2: Web development basics introduction to css

HTML AND CSS

LECTURE 8

Page 3: Web development basics introduction to css

TOPICS

CSS introduction

what is css?

why separate form, linking to html file?

Self-closing tags?

Page 4: Web development basics introduction to css

WHAT CSS IS?

CSS which stands for Cascading Style Sheets is a language used to describe the appearance and formatting of your HTML.

A style sheet is a file that describes how an HTML file should look like ,that’s it.

We say these style sheets are cascading because the sheets can apply formatting when more than one style applies.

For instance, if you say all paragraphs should have blue font, but you specifically single out one paragraph to have red font, CSS can do that.

Page 5: Web development basics introduction to css

SAMPLE HTML FILE

<!DOCTYPE html>

<html>

<head>

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

<title>Fancy Fonts</title>

</head>

<body>

<p>I'm a paragraph written in red font, but one of my words is <span>blue</span>!</p> </body></html>

Page 6: Web development basics introduction to css

SAMPLE CSS FILE

P

{

color: GREEN;

}

Span

{

color:blue;

}

Page 7: Web development basics introduction to css

WHY SEPARATE FORM FROM FUNCTION?

There are two main reasons for separating your form/formatting (CSS) from your functional content/structure (HTML):

1. You can apply the same formatting to several HTML elements without rewriting code

(e.g. style=“color:red”) over and over

2. You can apply similar appearance and formatting to several HTML pages from a single CSS file

Page 8: Web development basics introduction to css

SAMPLE HTML FILE <!DOCTYPE html>

<html>

<head>

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

<title>Even Fancier Fonts</title>

</head>

<body>

<p>Much of this is regular text, but some of it is <span>fancy</span>!We can use our <span>newly fancified font</span> to add some<span>flair</span> to our website. It'd be a <span>royal pain</span>

to make each of these span tags <span>fancy</span> individually,but it's a cinch with <span>CSS</span>!</p>

</body></html>

Page 9: Web development basics introduction to css

SAMPLE CSS FILE

Span

{

font-family:cursive;

}

Page 10: Web development basics introduction to css

LINKING THEM ?

You know you should write your CSS in a totally separate file. But how do you make sure your HTML file can see that CSS

information?

You do this by putting a <link> tag in between <head>tags of your html page.

<link> tag needs three attributes:

1. A type attribute that should always be equal to “text/css”

2.A rel attribute that should always be equal to “stylesheet”

3.A href attribute that should point to the web address of your css file

Page 11: Web development basics introduction to css

SAMPLE HTML FILE

<!DOCTYPE html>

<html>

<head>

<title>Result</title>

</head>

<body>

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

<p>I want to be SIZE 44 font!</p>

</body>

</html>

Page 12: Web development basics introduction to css

SAMPLE CSS FILE

p

{

font-size: 44px;

}

Page 13: Web development basics introduction to css

REFERENCES

• www.codecademy.com

Head first web design .

Learning web design-Jennifer Niederst Robbins

www.w3schools.com

Page 14: Web development basics introduction to css

Thank you

Any doubts

Email: [email protected]