CSS. CSS, or Cascading Styles Sheets, is a way to style HTML. Whereas the HTML is the content, the style sheet is the presentation of that document.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

1 © Netskills Quality Internet Training, University of Newcastle Introducing Cascading Style Sheets © Netskills, Quality Internet.
CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
Intro To Cascading Style Sheets By Mario Yannakakis.
CSS Basics Style and format your web site using CSS.
Cascading Style Sheets (CSS). Cascading Style Sheets With the explosive growth of the World Wide Web, designers and programmers quickly explored and reached.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Cascading Style Sheets
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
Cascading Style Sheets: Basics I450 Technology Seminar Copyright 2003, Matt Hottell.
Cascading Style Sheets (CSS) “Styles” for short. Pg. 418.
Cascading Style Sheets
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
Introducing CSS CIS 133 mashup Javascript, jQuery and XML 1.
Introduction to CSS. What is CSS? A CSS (cascading style sheet) file allows you to separate your web sites (X)HTML content from it’s style. Use your (X)HTML.
HTML – A Brief introduction Title of page This is my first homepage. This text is bold  The first tag in your HTML document is. This tag tells your browser.
Introduction to CSS.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
© 2004, Robert K. Moniot Chapter 6 CSS : Cascading Style Sheets.
End User Computing An Introduction to CSS Sujana Jyothi Research Lab1, Callan Building, Department of Computer Science
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
Cascading Style Sheets Based on Castro, HTML for the WWW, 6 th edition Ron Gerton, Fall 2007.
“Cascading Style Sheets” for styling WWW information DSC340 Mike Pangburn.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Selectors thru Borders. CSS – Cascading Style Sheets – is a way to style HTML HTML is the content base of a web page CSS provides the presentation qualities.
HIGHER COMPUTING CSS. WHAT IS CSS? CSS: Cascaded Style Sheets used to separate a web site’s content(information) from its style(how it looks).
Basics of HTML.
STYLING THE WEBSITE - EXTERNAL CSS BY JORGE MARTINEZ.
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
HTML GUIDE Press F5 and then Click on the links on the left to get to the section you want Section 1: Getting Started Section 2: Moving Banner Section.
Cascading Style Sheets Creating a Uniform Site. Style Sheets  Style sheets are used for conformity on a web page or web site.  Style sheets eliminate.
Cascading Style Sheets
Getting Started with HTML. HTML  Hyper Text Markup Language  HTML isn’t a program language, its known as a markup language  A Markup language has tags.
Style Sheets. Coding Style Sheets  Style sheets use RULES to create the style  A selector (a tag or user-defined style name)  and then declarations.
CSS Syntax. Syntax The CSS syntax is made up of three parts: a selector, a property and a value: selector {property: value}
CSS Cascading Style Sheets *referenced from
CSS DHS Web Design. Location Between the & Start with – End with –
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
WEB FOUNDATIONS CSS Overview. Outline  What is CSS  What does it do  Where are styles stored  Why use them  What is the cascade effect  CSS Syntax.
Cascading Style Sheets
Web Development & Design Foundations with XHTML
CSS Nick Sims.
CS3220 Web and Internet Programming CSS Basics
Style Sheets.
Introduction to CSS.
Madam Hazwani binti Rahmat
Cascading Style Sheets (CSS)
Intro to CSS CS 1150 Fall 2016.
Cascading Style Sheets - Building a stylesheet
Introduction to CSS.
Intro to CSS CS 1150 Spring 2017.
Software Engineering for Internet Applications
Stylin’ with CSS.
Introduction to Cascading Style Sheets (CSS)
What are Cascading Stylesheets (CSS)?
Web Development & Design Foundations with H T M L 5
CS3220 Web and Internet Programming CSS Basics
CSS Styles Fonts and Colors.
Introduction to CSS.
CS3220 Web and Internet Programming CSS Basics
Cascading Style Sheets - Building a stylesheet
Stylin’ with CSS.
Stylin’ with CSS.
Cascading Style Sheets
Presentation transcript:

CSS

CSS, or Cascading Styles Sheets, is a way to style HTML. Whereas the HTML is the content, the style sheet is the presentation of that document.

I N - LINE In-line styles are dropped straight into the HTML tags using the style attribute. They look something like this: text This will make that specific paragraph red. This works fine, and there is nothing wrong with it per se, except that now if you wanted to say change all your text that you initially made bold to underlined, you would have to go to every spot in the page and change the tag.

I NTERNAL Embedded, or internal styles are used for the whole page. Inside the head tags, the style tags surround all of the styles for the page. head style This would look something like this: (see next slide) This will make all of the paragraphs in the page red and all of the links blue.

CSS Example p {color: red;} a {color: blue;}...

H OW TO CREATE A LINKED EXTERNAL STYLESHEET To create an external style sheet all you need to do is create a simple text document (on windows you simply right- click and select new -> text document) and then change the file from type.txt to.css. You can change the file type by just changing the file’s extension. The file’s extension on windows tells the computer what kind of file it is and allows the computer to determine how to handle the file when for example you try to open it.

External styles are used for the whole, multiple- page website. There is a separate CSS file, which will simply look something like: p { color: red; } a { color: blue; }

If this file is saved as "web.css" then it can be linked to in the HTML like this: CSS Example

Whereas HTML has tags, CSS has ' selectors '. Selectors are the names given to styles in internal and external style sheets. In this CSS Beginner Tutorial we will be concentrating on HTML selectors, which are simply the names of HTML tags and are used to change the style of a specific tag. For each selector there are ' properties ' inside curly brackets, which simply take the form of words such as color, font-weight or background- color.colorfont-weightbackground- color

A value is given to the property following a colon (NOT an 'equals' sign) and semi-colons separate the properties. body { font-size: 0.8em; color: navy; }

This will apply the given values to the font-size and color properties to the body selector. font-sizecolor So basically, when this is applied to an HTML document, text between the body tags (which is the content of the whole window) will be 0.8 ems in size and navy in colour.body

COLOR ' AND ' BACKGROUND - COLOR ' Colours can be applied by using color and background-color (note that this must be the American English 'color' and not 'colour'). color background-color These colours might be a little too harsh, so you could change the code of your CSS file for slightly different shades:

body { font-size: 0.8em; color: navy;} h1 { color: #ffc;background-color: #009; }

FONT - FAMILY This is the font itself, such as Times New Roman, Arial, or Verdana. The font you specify must be on the user's computer, so there is little point in using obscure fonts. There are a select few ' safe ' fonts (the most commonly used are arial, verdana and times new roman), but you can specify more than one font, separated by commas. The purpose of this is that if the user does not have the first font you specify, the browser will go through the list until it finds one it does have. Note: if the name of a font is more than one word, it should be put in quotation marks, such as font- family: "Times New Roman".

FONT - SIZE The size of the font. Be careful with this - text such as headings should not just be a paragraph in a large font; you should still use headings (h1, h2 etc.) even though, in practice, you could make the font-size of a paragraph larger than that of a heading.h1h2

FONT - WEIGHT & FONT - STYLE This states whether the text is bold or not. In practice this usually only works as font-weight: bold or font- weight: normal. This states whether the text is italic or not. It can be font-style: italic or font-style: normal.

PUTTING IT TOGETHER body { font-family: arial, helvetica, sans-serif; font-size: 80%; color: black; background-color: #ffc; }