SlideShare a Scribd company logo
Layout (CSS)Cascading Style Sheets
What is CSS?CSS stands for Cascading Style SheetsStyles define how to display HTML elementsStyles were added to HTML 4.0 to solve a problemExternal Style Sheets can save a lot of workExternal Style Sheets are stored in CSS files
CSS Saves a Lot of Work!CSS defines HOW HTML elements are to be displayed.Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file!
CSS SyntaxA CSS rule has two main parts: a selector, and one or more declarations:The selector is normally the HTML element you want to style.Each declaration consists of a property and a value.The property is the style attribute you want to change. Each property has a value.
CSS CommentsComments are used to explain your code, and may help you when you edit the source code at a later date. Comments are ignored by browsers.A CSS comment begins with "/*", and ends with "*/", like this:/*This is a comment*/p{text-align:center;/*This is another comment*/color:black;font-family:arial;}
CSS is the better half of HTML. And in coding, there is no equality of status: HTML takes care of the rough stuff (the structure), while CSS gives it a nice touch (layout).
One of the smart features of CSS is the possibility to manage your layout centrally. Instead of using the style attribute in each tag, you can tell the browser once how it must layout all the text on the page:
<html> <head> <title>My first CSS page</title> 	<style type="text/css"> 		h1 {font-size: 30px; font-family: arial;} 		h2 {font-size: 15px; font-family: courier;} 	p {font-size: 8px; font-family: "times new roman";} </style></head> <body> <h1>My first CSS page</h1> <h2>Welcome to my first CSS page</h2><p>Here you can see how CSS works </p></body> </html>
What else can I do with CSS?CSS can be used for much more than specifying font types and sizes. For example, you can add colours and backgrounds. Here are some examples for you to experiment with.
<p style="color:green;">Green text</p> <h1 style="background-color: blue;">Heading on blue background</h1> <body style="background-image: url('http://www.html.net/logo.png');">
Is CSS nothing but colours and font types?CSS can also be used to control the page setup and presentation (margins, float, alignment, width, height etc.). By regulating the different elements with CSS you are able to layout your pages elegantly and precisely.
<p style="padding:25px;border:1px solid red;">I love CSS</p>ResultI Love CSS
With the property float an element can either be floated to the right or to the left.<imgsrc="bill.jpg" alt="Bill Gates" style= "float:left;" /> <p>Loremipsumdolor sit amet, consectetueradipiscingelit, seddiamnonummynibheuismodtinciduntutlaoreetdolore magna aliquameratvolutpat. Utwisienim ad minim veniam, quisnostrudexercitationullamcorpersuscipitlobortisnislutaliquip ex ea commodoconsequat...</p>
Css intro

More Related Content

PPT
Css Best Practices
PPTX
Webdesign
PPT
INFO3775 Chapter 2 Part 2
PPTX
Html & CSS
PPTX
HTML and CSS
PPTX
Html and css
PPT
Week3 css
PPSX
Session Two css
Css Best Practices
Webdesign
INFO3775 Chapter 2 Part 2
Html & CSS
HTML and CSS
Html and css
Week3 css
Session Two css

What's hot (17)

PPSX
Session 2 intro to Css
PPTX
Css external style sheet
PPTX
CSS- Cascading Style Sheet
PPTX
HTML- Hyper Text Markup Language
PPTX
Css inclusion
PPTX
Css introduction
PPT
Boostrap basics
PPTX
Web development using HTML and CSS
PDF
Html css
PPTX
Introduction to web design discussing which languages is used for website des...
PPTX
Cascading Style Sheets
PDF
[Basic HTML/CSS] 0. introduction
PPT
Creating your first web page
PPTX
PPT
Introduction to Html
PPTX
Basic Webpage
PDF
Intro to HTML & CSS
Session 2 intro to Css
Css external style sheet
CSS- Cascading Style Sheet
HTML- Hyper Text Markup Language
Css inclusion
Css introduction
Boostrap basics
Web development using HTML and CSS
Html css
Introduction to web design discussing which languages is used for website des...
Cascading Style Sheets
[Basic HTML/CSS] 0. introduction
Creating your first web page
Introduction to Html
Basic Webpage
Intro to HTML & CSS
Ad

Viewers also liked (13)

PPTX
What is css
PPTX
Html styles
PPTX
Week 12 CSS - Review from last week
ODP
PPTX
Css ppt
PPTX
Cascading style sheet
PPTX
Cascading Style Sheet (CSS)
PPTX
Css types internal, external and inline (1)
PPT
Html Ppt
PDF
Html / CSS Presentation
What is css
Html styles
Week 12 CSS - Review from last week
Css ppt
Cascading style sheet
Cascading Style Sheet (CSS)
Css types internal, external and inline (1)
Html Ppt
Html / CSS Presentation
Ad

Similar to Css intro (20)

PPT
PPT
Cascading style sheet (css)]
PPT
PPTX
PPT
CSS Basics
PPTX
PPTX
PPTX
Cascading Style Sheets (CSS) - An introduction
PPTX
v5-introduction to html-css-210321161444.pptx
PPTX
Upstate CSCI 450 WebDev Chapter 3
PPTX
UNIT 3WOP fgfufhbuiibpvihbvpihivbhibvipuuvbiuvboi
PPTX
1 03 - CSS Introduction
DOC
Css introduction
PDF
PDF
Css tutorial
Cascading style sheet (css)]
CSS Basics
Cascading Style Sheets (CSS) - An introduction
v5-introduction to html-css-210321161444.pptx
Upstate CSCI 450 WebDev Chapter 3
UNIT 3WOP fgfufhbuiibpvihbvpihivbhibvipuuvbiuvboi
1 03 - CSS Introduction
Css introduction
Css tutorial

More from Andz Bass (6)

PPT
Netiquette
PPTX
Working with html tables
PPTX
Working with tables
PPTX
Imagetag
PPTX
Html links
PPTX
Basic webpage layout and design
Netiquette
Working with html tables
Working with tables
Imagetag
Html links
Basic webpage layout and design

Css intro

  • 2. What is CSS?CSS stands for Cascading Style SheetsStyles define how to display HTML elementsStyles were added to HTML 4.0 to solve a problemExternal Style Sheets can save a lot of workExternal Style Sheets are stored in CSS files
  • 3. CSS Saves a Lot of Work!CSS defines HOW HTML elements are to be displayed.Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file!
  • 4. CSS SyntaxA CSS rule has two main parts: a selector, and one or more declarations:The selector is normally the HTML element you want to style.Each declaration consists of a property and a value.The property is the style attribute you want to change. Each property has a value.
  • 5. CSS CommentsComments are used to explain your code, and may help you when you edit the source code at a later date. Comments are ignored by browsers.A CSS comment begins with "/*", and ends with "*/", like this:/*This is a comment*/p{text-align:center;/*This is another comment*/color:black;font-family:arial;}
  • 6. CSS is the better half of HTML. And in coding, there is no equality of status: HTML takes care of the rough stuff (the structure), while CSS gives it a nice touch (layout).
  • 7. One of the smart features of CSS is the possibility to manage your layout centrally. Instead of using the style attribute in each tag, you can tell the browser once how it must layout all the text on the page:
  • 8. <html> <head> <title>My first CSS page</title> <style type="text/css"> h1 {font-size: 30px; font-family: arial;} h2 {font-size: 15px; font-family: courier;} p {font-size: 8px; font-family: "times new roman";} </style></head> <body> <h1>My first CSS page</h1> <h2>Welcome to my first CSS page</h2><p>Here you can see how CSS works </p></body> </html>
  • 9. What else can I do with CSS?CSS can be used for much more than specifying font types and sizes. For example, you can add colours and backgrounds. Here are some examples for you to experiment with.
  • 10. <p style="color:green;">Green text</p> <h1 style="background-color: blue;">Heading on blue background</h1> <body style="background-image: url('http://www.html.net/logo.png');">
  • 11. Is CSS nothing but colours and font types?CSS can also be used to control the page setup and presentation (margins, float, alignment, width, height etc.). By regulating the different elements with CSS you are able to layout your pages elegantly and precisely.
  • 12. <p style="padding:25px;border:1px solid red;">I love CSS</p>ResultI Love CSS
  • 13. With the property float an element can either be floated to the right or to the left.<imgsrc="bill.jpg" alt="Bill Gates" style= "float:left;" /> <p>Loremipsumdolor sit amet, consectetueradipiscingelit, seddiamnonummynibheuismodtinciduntutlaoreetdolore magna aliquameratvolutpat. Utwisienim ad minim veniam, quisnostrudexercitationullamcorpersuscipitlobortisnislutaliquip ex ea commodoconsequat...</p>