The Characteristics of CSS

Slides:



Advertisements
Similar presentations
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Advertisements

Computer Applications II.  A Style Sheet is a web page development tool that allows the developer to make global changes to a web page (or web site)
Cascading Style Sheets
Today CSS HTML A project.
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.
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
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.
กระบวนวิชา 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.
CSS normally control the html elements. Three Ways to Insert CSS There are three ways of inserting a style sheet: External style sheet Internal style.
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.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
16 HTML Tables and Frames Section 16.1 Create a basic table using HTML Define borders Merge cells Align content in tables Section 16.2 Create a frames-based.
CSS Pertemuan 12 Matakuliah: L0182 / Web & Animation Design Tahun: 2008.
4.01 Cascading Style Sheets
CM143 Week 4 Introducing CSS. Cascading Style Sheets A definition for the style in which an element of the webpage will be displayed Border width, colour,
Using Cascading Style Sheets (CSS) Dept. of Computer Science and Computer Information CSCI N-100.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
Review HTML  What is HTML?  HTML is a language for describing web pages.  HTML stands for Hyper Text Markup Language  HTML is not a programming language,
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
CSS Style Rules Guang Tong, Zhan L;lo’p[ Css Style Rule Guang Tong Zhan Three ways to insert CSS 1 External style sheet 2 Internal style sheet 3 Inline.
Cascading style sheets (CSS)
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
CSS Netcentric. What is CSS O CSS stands for Cascading Style Sheets O Styles define how to display HTML elements O Styles were added to HTML 4.0 to solve.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CO1552 – Web Application Development Cascading Style Sheets.
INTRODUCTION TO CSS. OBJECTIVES: D EFINE WHAT CSS IS. K NOW THE HISTORY OF CSS. K NOW THE REASON WHY CSS IS USED. CSS SYNTAX. CSS ID AND CLASS.
CSS CSS is short for C ascading S tyle S heets. It is a new web page layout method that has been added to HTML to give web developers more control over.
CSS Basic (cascading style sheets)
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
Essentials of HTML Class 4 Instructor: Jeanne Hart
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Use CSS to Implement a Reusable Design Selecting a Dreamweaver CSS Starter Layout is the easiest way to create a page with a CSS layout You can access.
A really fairly simple guide to: mobile browser-based application development (part 2, CSS) Chris Greenhalgh G54UBI / Chris Greenhalgh
DIV, Span, CSS.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
1 © Netskills Quality Internet Training, University of Newcastle Using Style Sheets in Dreamweaver CS © Netskills, Quality Internet Training, University.
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
CSS Hadas Kahsay. Overview  What is CSS  Basic syntax of CSS Rules  How to link CSS style to html documents  Browsers and CSS  Advantages of CSS.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
How to… Cascading Style Sheets. How to Insert a Style Sheet When a browser reads a style sheet, it will format the document according to it. There are.
Cascading Style Sheets (CSS) EXPLORING COMPUTER SCIENCE – LESSON 3-5.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
What is CSS? A set of style rules that tell the web browser how to present a web page or document. – In earlier versions of HTML, style characteristics,
Cascading Style Sheets - CSS December 20, 2008 NTPCUG Expression Web SIG.
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
Cascading Style Sheets Using HTML. What are they? A set of style rules that tell the web browser how to present a web page or document. In earlier versions.
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 (CSS)
4.01 Cascading Style Sheets
>> Introduction to CSS
CX Introduction to Web Programming
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Styles and the Box Model
What are Cascading Stylesheets (CSS)?
Training & Development
Web Design and Development
Exercise 9 Skills You create and use styles to create formatting rules that can easily by applied to other pages in the Web site. You can create internal.
Web Design & Development
4.01 Cascading Style Sheets
Web Programming and Design
Presentation transcript:

The Characteristics of CSS Unit 20: Client Side Customisation of Web Pages

Contents CSS frameworks Box model Accessing CSS from HTML Selectors Height and width Content Padding Border Margin Accessing CSS from HTML Inline Embedded External Selectors Class Selectors ID

CSS Frameworks CSS stands for Cascading Style Sheets. It is a coding language that allows you to change elements such as text, colour, size, background colours, border styles and the positioning of elements on a web page. The theory behind CSS frameworks is that it reduces the repetitiveness of styling web sites and having to type the same bits of code again and again. They are simply files that can control the appearance of your web pages or standardise web sites and help avoid mistakes and browser compatibility problems.

Uses of CSS CSS has many, many uses, the easier ones to comprehend include controlling and editing the: background colour background images formatting text borders padding heading styles positioning elements creating columns

Box Model The term "box model" is used when talking about design and layout in CSS. It really is just a box and consists of margins, borders, padding, and the actual content. The box model allows a border to be placed around elements and space to be placed in between elements. In order to set the width and height of an element correctly in all browsers, you need to know how the box model works.

Height and Width When you set the height and width of an element in your web page, you are setting the height and width of the content area of your box. You need to know the values given to the padding, border and margins in order to know the true amount of space the box will take up.

Content The content area is where you text or images will go. You can change the background colour of this area as well as setting the height and width.

Padding Padding is the space between the content and the border. This is just empty space. Its background colour is determined by the colour of the content area.

Border The border goes around the padding and the content. The border can have different attributes. For example, the line can be different thicknesses, colours and can even be dotted or dashed.

Margin The margin is the space between the border and any other information (if any) on the web page. The margin does not have a background colour, it is completely transparent

Accessing CSS There are three ways of accessing CSS from HTML pages, they are: In-line Embedded (aka header) External

In-line <p style="color:#CC00FF">This is a paragraph.</p> The inline style requires the style attribute to be inside the opening <p> tag within the <body> section of the html code. This applies the style to that section of the page only. <p style="color:#CC00FF">This is a paragraph.</p> If using this style is you would have to write out the attribute and declarations for each paragraph throughout your html code. Inline styles are a simple way of applying a theme to specific sections of a document, but it is not the best method of styling a page.

Embedded The embedded style (aka header) requires the style attribute to be set in just one place instead of having to type them out every time you want them. An embedded style lets you set out the code for all the styles you want to use on that page just once in the header section. <head> <style type="text/css"> hr {color:sienna;} p {margin-left:20px;} body {background-image:url("images/back40.gif");} </style> </head> The benefit of this style is if you wanted to change the colour of all the paragraph text to red for example, you only need to change it in the style sheet at the top of the page.

External An external style sheet gives a location in which you can put styles that can be applied on all of your web pages. Your web page then only needs to refer to the external style sheet in the header section and the browser looks to the other document in order to know how to present elements of the web pages. <head> <link rel="stylesheet" type="text/css" href="mystyle.css" /> </head>

Implementation styles tip What are the main advantages and disadvantages of each implementation style? For a merit, it is essential that you compare the styles, highlighting the pros and cons of each and give plenty of examples.

Selectors P { font-weight: bold; color: blue; } Curly brace Declaration Property Value What other selectors, properties and values can you think of?

Class selectors The implementation styles mentioned provide quite a blanket approach to styling your pages. However, you may want some sections to look a bit different to the rest. This is where class selectors are used. .fun { color: #339999; font-family: Georgia, Time, Serif; text-align: center; }

Class selectors The previous section of code would (if you were efficient) be in your external style sheet and the following would be in the body section of your web page: <p class=“fun”>A man walks into a bar; you would’ve thought he’d see it coming!<p>

ID The id selector is used to specify a style for a single, unique element. The id selector uses the id attribute of the HTML element, and is defined with a "#". The style rule below will be applied to the element with id="paragraph1": #paragraph1 { text-align:center; color:red; } Do NOT start an ID name with a number! It will not work in Mozilla/Firefox.

Class vs id The one main difference between these selectors: a specific id can only be applied to one XHTML element. So, for example, on any web page, there can only be one element with an id of main navigation, and only one with an id of header. A class, however, can appear as many times as required.

conclusion Write a conclusion about the benefits of CSS. E.g.: pages download faster you have to type less code your pages are shorter and neater the look of the site is kept consistent throughout all of the pages that work off the same style sheet errors caused by editing multiple html pages occur less often updating your design and general site maintenance are made much easier.