CSS Cascading Style Sheets Please fasten your seat belt.

Slides:



Advertisements
Similar presentations
HTML and CSS. HTML Hyper Text Markup Language Tells browser how to display text and images.
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 Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Cascading Style Sheets
/k/k 1212 Cascading Style Sheets Part one Marko Boon
Today CSS HTML A project.
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
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.
Introduction to CSS.
Very quick intro HTML and CSS. Sample html A Web Title.
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 Basics. Why use Cascading Style Sheets? Allows you to set up a series of rules for all pages in a site. The series may be changed.
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.
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,
CSW131 Steven Battilana 1 CSW 131 – Chapter 5 (More) Advanced CSS Prepared by Prof. B. for use with Teach Yourself Visually Web Design by Ron Huddleston,
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
กระบวนวิชา 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.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
4.01 Cascading Style Sheets
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.
Cascading style sheets (CSS)
The Characteristics of CSS
Bare bones notes. Suggested organization for main folder. REQUIRED organization for the 115 folder.
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.
 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.
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)
Bare bones slide show. The format is text files, with.htm or.html extension. Hard returns, tabs, and extra spaces are ignored. DO NOT use spaces in file.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
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}
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.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
WebD Introduction to CSS By Manik Rastogi.
CSS.
Web Development & Design Foundations with XHTML
4.01 Cascading Style Sheets
Unit 3 - Review.
>> Introduction to CSS
CX Introduction to Web Programming
Web Developer & Design Foundations with XHTML
Cascading Style Sheets (CSS)
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Structuring Content in a Web Document
Website Design 3
Introduction to CSS.
CSS Cascading Style Sheets
Web Programming– UFCFB Lecture 11
What are Cascading Stylesheets (CSS)?
How to use the CSS box model for spacing, borders, and backgrounds
Training & Development
Creating your own Styles
4.01 Cascading Style Sheets
Introduction to Styling
Presentation transcript:

CSS Cascading Style Sheets Please fasten your seat belt.

Let’s talk about the weather. What are some of the characteristics that you could use to describe the weather? For example: Max Temperature 122.5

Defining the characteristics of the weather. weather { rain: 4in; hi-temp: 107; low-temp: 82; sky: ps; } Selector Property value pair

How styles are defined Selector(s) { One or more attribute-value pairs; } For example: h3 { text-align: center; font-size: 16px; } or h3 { text-align: center; font-size: 16px; }

Style syntax – these rules are different than HTML. p { line-height: 1.6em; font-family: verdana, arial, helvetica, sans-serif; } Pay special attention to: Spellig { } : ; You should never have HTML in your styles.

Example 1 –Traditional one property value pair per line h1 { text-align: right; color: blue; } h2 { text-align: right; color: blue; } h3 { text-align: right; color: blue; } Example2 - You can define styles for multiple selectors. h1, h2, h3 { text-align: right; color: blue; } Example3 – property value pairs can be on the same line. h1, h2, h3 { text-align: right; color: blue; } How can style rules be formatted?

What 5 items are wrong here? bdy{ font-size 12px; width: 150px margn: 10px; > body{ font-size: 12px; width: 150px; margin: 10px; }

Where can CSS rules be used? 1. In-line 2. Embedded styles in the head section 3. CSS file – separate file that your web page links to A style defined in a CSS file will be overridden by an embedded style. An embedded style will be overridden by an in-line style.

In-line style Use the style attribute in HTML elements. Center-aligned heading This is a paragraph. Heading without style This is a paragraph.

Embedded style a.k.a. Internal styles or header styles Use the style element in the head section. body{ font-size: 12px; margin: 20px; } h3{ text-align: center; } An HTML body tag would be This body is a style definition.

Let’s use our time machine to take a look at your future. TRAVEL TO YOUR FUTURE TRAVEL TO YOUR FUTURE

I have decided that you should update some of our web pages. They should use the Verdana font, a larger font size, wider margins and have the new company logo. How soon will you have this done? How many pages do you want updated? About 600 pages. Is there a problem getting them update by next Monday? I know you had a good CIS133 teacher. Right? What are you going to do? June 6, You working as a web person at a medium sized company.

External style sheet External style sheet are ideal when the style is applied to many pages. You can change the look of an entire site by changing just one file. CSS files are text files that are created and updated with a text editor – notepad. External styles are connected to the web page by the element in the section of the page:

What can be a selection in your CSS? 1. Html element – p, h1, body 2. Id – defined with id= can only be one with that name 3. Class – defined with class= and can be used repeatedly

ID's - unique Each element can have only one ID Each page can have only one element with that ID Code will not pass validation if you use the same ID on more than one element. Classes - NOT unique You can use the same class on multiple elements. You can use multiple classes on the same element. Any styling information that needs to be applied to multiple objects on a page should be done with a class. IDs vs Classes

Id Selectors aka ID Rules Veterinarian Seeking associate veterinarians, full or part-time considered.... T.A.S.K. 123 Main St Springfield BA #comp-name { text-align: center; } #comp-add { text-align: right; }

Class Selectors aka Class Rules Veterinarian Seeking associate veterinarians, full or part-time considered.... T.A.S.K. 123 Main St Springfield BA For more information contact ….thin { width: 60em; }

Selecting a block of code div tag lets you select a block of code – multiple paragraphs, headings, images etc. div can have an id. HTML We have a various items on sale every fourth Wednesday ….. CSS #sale { text-align: center; }

Each student is uniquely Identified. # Many students can be in a class. A class has a class meeting time called the class period. Examples: lesson-C/jobs1.html lesson-C/jobs2.html – added div tags lesson-C/jobs3.html – added id and class

Lakeland Reeds Bed and Breakfast Lakeland Reeds Bed and Breakfast About Us Lakeland Reeds is an ideal place to unplug from your daily routine, whether on the shore of Twin Lakes watching the sundown over the cattails or just curled up in a hammock on our screened wraparound porch with a good book. We're here to help you get the most out of your time with us, from canoes and life vests for a day out on the lake, to DVDs and popcorn for a quiet evening in. We look forward to welcoming you! Philip Blaine, Proprietor 45 Marsh Grass Ln. Marble, MN (218) Alex b Cook HTML5 Unit z Find the 10 errors in this code.

/* Lakeland Reeds Bed and Breakfast h2 { textalign: center; } #contact { text-align: right } #box { Border: 0.25em; border-style: solid; border-color: black; wide: 50em; margin-left: auto; margin-right: auto; padding: 1em; maintext { font: Verdana, Geneva, san-serif; text-align: left; width: 60%; margin-left: auto; margin-right: auto; color: clear; } Alex b Cook HTML5 Unit Z Find the 10 errors in this code.

Notepad++ This text editor can be downloaded for free. Save it to your USB for easy use any time you are editing a web page or a css file. Color coding will show once the file type is indicated. Has a run option to see in the browser.

Notice that in code on the left that at line 8, the #box is black in color instead of light blue. As you go backwards (up) you may notice in line 7 the closing bracket is the wrong bracket. By correcting this error the code after it now works. One of the advantages of Notepad++

1. Read again the instructions or steps. Did you misread or skip a step? 2. Develop and test small portions of code at a time. If there was not an error before you did an edit and now there is an error then, most likely the error is caused by something you edited. 3. Always check quotes and brackets. 4. Save and refresh. 5. Is what you are looking at in the browser the same file as the one you are editing? Always develop and test on your Flash drive. 6. Check for spelling – properties, file names and extensions, tags 7. Use different browser for viewing code. 8. Consider using a text editor like Notepad++ ROT - Rules of Thumb

If you are still stumped then publish your page, your style sheet, and any other needed items (images, scripts, fonts) to your eGCC space. Send me an to (not a Canvas message) with a link to the published address (i.e html) If I have the web address, I can look at both the html and the css (and any other items). Then I can you back and describe what is not working. Do not submit your URL in Canvas until you are ready to have your work graded.