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.

Slides:



Advertisements
Similar presentations
Nvu - How to Create Your Own Website From Start to Finish!Dr. Dawn Sherry & Dr. Barry J. Monk Dr. Dawn Sherry Dr. Barry J. Monk Assistant Professor of.
Advertisements

HIGH LEVEL OVERVIEW: CSS CSS SYNTAX CONSISTS OF A SET OF RULES THAT HAVE 3 PARTS: A SELECTOR, A PROPERTY, AND A VALUE. IT’S NOT NECESSARY TO REMEMBER THIS.
CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
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
Cascading Style Sheets
/k/k 1212 Cascading Style Sheets Part one Marko Boon
Cascading Style Sheets: Basics I450 Technology Seminar Copyright 2003, Matt Hottell.
Cascading Style Sheets
Today CSS HTML A project.
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
Introducing CSS CIS 133 mashup Javascript, jQuery and XML 1.
CSS. Intro to CSS Cascading Style Sheets – styles and enhances appearance of webpage.css extension.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Lecture 5 Use Cases and Style Sheets
Cascading Style Sheets (CSS): Pixel-Level Control with HTML Ease
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.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
CSS cont. October 5, Unit 4. Padding We can add borders around the elements of our pages To increase the space between the content and the border, use.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
End User Computing An Introduction to CSS Sujana Jyothi Research Lab1, Callan Building, Department of Computer Science
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
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.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
CSS(Cascading Style Sheets )
1 Dreamweaver CS5 intermediate class by Cookie Setton Build a CSS website WITHOUT TABLES Just when you thought you were starting to understand HTML coding,
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
“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.
Unit 20 - Client Side Customisation of Web Pages
Chapter 8 Creating Style Sheets.
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.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
4.01 Cascading Style Sheets
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
The Characteristics of CSS
Web Technologies Website Development Trade & Industrial Education
Website Development with Dreamweaver
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Working with Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 5.
Tutorial 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
© 2011 Delmar, Cengage Learning Chapter 8 Using Styles and Design Style Sheets for Design.
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
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.
1 Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size, font color etc…
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.
WebD Introduction to CSS By Manik Rastogi.
CSS.
CS3220 Web and Internet Programming CSS Basics
4.01 Cascading Style Sheets
( Cascading style sheet )
CSS Rule Selector Declaration Block Value Attribute Name body {
Madam Hazwani binti Rahmat
ASP.NET Web Controls.
Using Cascading Style Sheets Module B: CSS Structure
Cascading Style Sheets (Layout)
IS333: MULTI-TIER APPLICATION DEVELOPMENT
CSS Style Sheets: Intro
Cascading Style Sheets™ (CSS)
Using Cascading Style Sheets (CSS)
CS3220 Web and Internet Programming CSS Basics
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.
CS3220 Web and Internet Programming CSS Basics
4.01 Cascading Style Sheets
Introduction to Cascading Style Sheets (CSS)
Presentation transcript:

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 CSS

Why do we need CSS? Our designing purpose: ▫ Create a theme for website ▫ To have a indentify look throughout our website

Why do we need CSS? How to do that ? ▫ Use a common layout for all pages ▫ Use color of texts, links, buttons and graphics… reflecting that color theme for all page ▫ Use same font set for all page

Why do we need CSS? What have we done until now? ▫ Create a sample page with expected format, layout. ▫ Create specific pages as a copy of this sample page ▫ Modify design on each specific page.

Why do we need CSS? What if we want ? Do the whole design process again with new theme Or modify each existing pages to new design

Why do we need CSS? If your website has 2-3 pages ▫ No problem, I will re-design them. But if your website has 10, 20 … 100 pages ▫ Oh NO! I don’t have time to re-design all pages

Why do we need CSS? Using CSS helps you to save much time on change format, style and theme of your website. CSS even bring you more benefit in design.

What CSS is? CSS = Cascading Style Sheets

What CSS is? A style sheet is a set of rules to tell a web browser how to present the web page content ▫ i.e. how to display HTML elements

CSS Benefits Separate structure from appearance ▫ HTML establishes structure and content of a web page ▫ CSS controls appearance of the page Create consistent look-and-feel across multiple pages Ease of maintenance Reduce HTML file size

CSS structure CSS is a set of rules Sample of style sheet body { font-family: Tahoma, Arial, sans-serif; font-size: 13px; color: black; } h1 { font-size: 19px; border-bottom: 1px solid black }.shaded { background: #d0d0ff; } Rules

Rule Structure Have two parts ▫ Selector: tells a browser which HTML elements in a page will be affected by the rule. ▫ Declaration: tells the browser which set of properties to apply. Sample Style sheet

Slide 17 body { font-family: Tahoma, Arial, sans-serif; color: black; background: white; margin: 8px; } Selector Declaration Property Value Rule Structure

Slide 18 body { font-family: Tahoma, Arial, sans-serif; font-size: 13px; color: black; background: white; margin: 8px; } h1 { font-size: 19px; margin-top: 15px; margin-bottom: 5px; border-bottom: 1px solid black }.shaded { background: #d0d0ff; } First Section Heading Here is the first paragraph, containing text that really doesn't have any use or meaning; it just prattles on and on, with no end whatsoever, no point to make, really no purpose for existence at all. Another Section Heading Another paragraph. CSS:HTML: Applying CSS to HTML

Slide 19 First Section Heading Here is the first paragraph, containing text that really doesn't have any use or meaning; it just prattles on and on, with no end whatsoever, no point to make, really no purpose for existence at all. Another Section Heading Another paragraph. HTML: body { font-family: Tahoma, Arial, sans-serif; font-size: 13px; color: black; background: white; margin: 8px; } h1 { font-size: 19px; margin-top: 15px; margin-bottom: 5px; border-bottom: 1px solid black }.shaded { background: #d0d0ff; } CSS: Applying CSS to HTML

Internal Style Sheets ▫ Inline Styles ▫ Embedded style sheets External style sheets

Slide 21 Adding Styles to HTML... body { font-family: Tahoma, Arial, sans-serif;... } External style sheets Embedded style sheets Inline Styles

Inline Style Affects individual HTML tag some text

Embedded style sheets Affects individual HTML document... p {font-family: Arial, sans-serif;}... some text

External Style Sheets Styles are defined in separate text file (.css) ▫ styles.css, style1.css, style2.css HTML files (.html) have links to style sheet files (.css) ▫ Affect all HTML files that are linked to the style sheet

External Style Sheets styles.css file p { font-family: Arial, Sans-serif; } sample.html file some text

Cascading Order CSS uses an order of precedence to determine which styles to apply when a selector is formatted in different sources The least important style formatting is the browser’s default style settings

The cascading order of precedence for styles, starting with the least important to the most important, is as follows: 1.Browser default 2.External style sheets 3.Internal style sheets 4.Inline styles Cascading Order

Designing CSS

Selector Type Element Selectors H1 {color: purple;} H1, H2, P {color: purple;} body { font-family: Tahoma, Arial, sans-serif; color: black; background: white; margin: 8px; }

Selector Type Contextual Selector: Used when an HTML element can display more than one behaviour (e.g. hyperlinks) CSS: a:link {color: #000} a:visited {color: #000} a:hover {color: #69f} a:active {color: #000} HTML Next page

Selector Type ID Selector ▫ CSS … #red_heading {color: red} #summary {color: red} p#conclusion {color: blue} ▫ HTML … Headline Summary Conclusion …

Selector Type Class Selectors ▫ CSS: ….blue {color: #082984}.red {color: #de2131} ▫ HTML … Headline a summary some text …

The most frequently used HTML elements

CSS Properties Font ▫ Font styles: font family ▫ Type: size, weight, or variant Text ▫ Define the layout of blocks of text ▫ Words and characters ▫ Spacing ▫ Alignment ▫ Transformation (forced uppercase or lowercase) ▫ Decoration (underline, overline, and blinking)

CSS Properties Color and image ▫ Color and background formatting of text and images ▫ Define position of background image Border ▫ Define the style of borders for elements like tables, images, documents ▫ Border properties include width, height, style, color, margins, and padding. Display ▫ Define styles for the structure of the doc. ▫ Placement of elements (block or inline)

CSS1 Text Properties

Setting Font Properties

Boxes Properties

CSS Properties Visit here for full list of properties

Create External Cascading Style Sheets with Visual Studio

Create CSS file 1.Run VS : All program  Visual Studio 2005  Visual Studio Creating CSS file in VS: Choose menu File  New  File

Create CSS file 3.In the New File box, choose General in Categories and then choose Style Sheet in the right list. Finally, click Open button

Create CSS file 4.After a new CSS file is created, you can start to add rules to CSS file by typing CSS code in the editor or using design tools of Visual Studio.

Create CSS file 5.Save your CSS file when you’ve done by selecting File  Save or Save As  enter Filename in the Save box. And now, you have had an CSS to be used in all page of your website.

Add CSS rules There are two ways Typing CSS code in the editor Using design tools of Visual Studio.

Add CSS rules Using design tools for designing 1.On the Styles menu, click Add Style Rule. The Add Style Rule dialog box appears

Add CSS rules 2.In the Add Style Rule dialog box, select one of the following CSS selectors ▫ Element Defines a rule for an element by tag name. ▫ Class name Defines a rule for a CSS class. ▫ Element ID Defines a rule for an element with a specific ID. Enter the element name/Class name/ Element ID and then click OK:

Add CSS rules 3.Find the new style selector and then place the cursor between the braces ( { } ). 4.On the Styles menu, click Build Style. 5.In the Style Builder dialog box, define the style attributes that you want the element to have, and then click OK. The Style Builder dialog box inserts CSS style attributes within the braces ( { } ) of the style selector.

Link Cascading Style Sheets to HTML page After you have defined an external cascading style sheet (CSS) you can link the style sheet to individual HTML Web pages to apply the styles to the elements on the page. 1.Open the HTML page in Visual Studio 2.Select Source view windows 3.Add a link element inside the tags on the Web page. Example: MyStyles.css is the filename of CSS file you’ve created NOTE: Remember to upload all CSS files that you linked to your web pages

Using template for web design

Web template Templates are sample web pages that are designed in a specific theme ▫ Just need to add content to template page ▫ No design effort require Use available template for time saving in web design

Web template A template often include:  One or few sample web pages (HTML, PHP, ASP…)  Cascading Style Sheets Files  Images used in template There are a lot templates available in Internet for free download or charged download A download template need to be customized for best fit your design requirement  knowledge in HTML, CSS is useful.

Free Web templates

Practicing

Creating a template for your website The template include ▫ A sample HTML file with specific layout for your website ▫ A CSS file with rules for design of sample file ▫ Images ( if needed ) Using this template to re-design your existing website

Examples CSS navigation menu resources/css/css-navigation-menu.shtml