44

Topic 03 : Introduction to CSS

Embed Size (px)

Citation preview

Page 1: Topic 03 : Introduction to CSS
Page 2: Topic 03 : Introduction to CSS
Page 3: Topic 03 : Introduction to CSS
Page 4: Topic 03 : Introduction to CSS

selector {property1 : value; property2 : value;

}

Generic structure

h1{color : red; font-size : 18px;

}

A Simple CSS Rule

Page 5: Topic 03 : Introduction to CSS
Page 6: Topic 03 : Introduction to CSS

h1{color : red; font-size : 18px;

}

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

Save in a file named style.css

<link/> element that links to style.css

Page 7: Topic 03 : Introduction to CSS

<style type="text/css">

h1 { color : green; font-size : 18px; }

</style>

</head>

<body>

<h1>Welcome to <em>Cascading Style Sheets</em></h1>

<p>The purpose of this page is to demonstrate how <em>CSS</em> works.</p>

Page 8: Topic 03 : Introduction to CSS

...

<h1 style="color:blue; font-size:5px;">Welcome to <em>Cascading Style

Sheets</em></h1>

<p>The purpose of this page is to demonstrate how <em>CSS</em> works.</p>

...

Page 9: Topic 03 : Introduction to CSS
Page 10: Topic 03 : Introduction to CSS
Page 11: Topic 03 : Introduction to CSS

h1, p {color:red;

}

*{text-align:right;

}

Page 12: Topic 03 : Introduction to CSS

<body>

<h1>Welcome to <em>Cascading Style Sheets</em></h1>

<p>The purpose of this page is to demonstrate how <em>CSS</em> works.</p>

</body>

body{color:blue;

}h1{

color:red;}

Page 13: Topic 03 : Introduction to CSS

<body>

<h1>Welcome to <em>Cascading Style Sheets</em></h1>

<p>The purpose of this page is to demonstrate how <em>CSS</em> works.</p>

</body>

p em{color:red;

}

Page 14: Topic 03 : Introduction to CSS
Page 15: Topic 03 : Introduction to CSS
Page 16: Topic 03 : Introduction to CSS
Page 17: Topic 03 : Introduction to CSS
Page 18: Topic 03 : Introduction to CSS
Page 19: Topic 03 : Introduction to CSS
Page 20: Topic 03 : Introduction to CSS
Page 21: Topic 03 : Introduction to CSS
Page 22: Topic 03 : Introduction to CSS
Page 23: Topic 03 : Introduction to CSS
Page 24: Topic 03 : Introduction to CSS
Page 25: Topic 03 : Introduction to CSS
Page 26: Topic 03 : Introduction to CSS
Page 27: Topic 03 : Introduction to CSS
Page 28: Topic 03 : Introduction to CSS
Page 29: Topic 03 : Introduction to CSS
Page 30: Topic 03 : Introduction to CSS
Page 31: Topic 03 : Introduction to CSS
Page 32: Topic 03 : Introduction to CSS
Page 33: Topic 03 : Introduction to CSS
Page 34: Topic 03 : Introduction to CSS

–Margin, border and padding can be specified for particular sides of elements. – E.g. div { padding-top : 10px; }

Page 35: Topic 03 : Introduction to CSS
Page 36: Topic 03 : Introduction to CSS
Page 37: Topic 03 : Introduction to CSS
Page 38: Topic 03 : Introduction to CSS
Page 39: Topic 03 : Introduction to CSS
Page 40: Topic 03 : Introduction to CSS
Page 41: Topic 03 : Introduction to CSS
Page 42: Topic 03 : Introduction to CSS
Page 43: Topic 03 : Introduction to CSS
Page 44: Topic 03 : Introduction to CSS