Methods for configuring Cascading Style Sheets. Applying style to element name selectors. Style Rule Basics. CMPT 165: Cascading Style Sheets

Size: px
Start display at page:

Download "Methods for configuring Cascading Style Sheets. Applying style to element name selectors. Style Rule Basics. CMPT 165: Cascading Style Sheets"

Transcription

1 CMPT 165: Cascading Style Sheets Tamara Smyth, School of Computing Science, Simon Fraser University October 7, 2011 Methods for configuring Cascading Style Sheets There are 4 method to incorporating CSS in a website: 1. Inline: coded in the body of the web pages as an attribute of an HTML tag. Style only applies to that element. 2. Embedded: defined in the head section of a web page. Style applies to entire web page document. 3. External: coded in a separate text file called an external style sheet. Style applies to all web pages coding a link element in the head section. 4. Imported: similar to external. can be imported into embedded styles or into another external style sheet using the import directive. 1 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 2 Style Rule Basics Applying style to element name selectors Style sheets are composed of rules that describe the styling to be applied to a web page. Each rule has 2 parts: 1. a selector 2. a declaration CSS Style Rule Selector can be the HTML name for: 1. an element 2. a class 3. an id CSS Style Rule Declaration indicates the CSS property you are setting (e.g. colour) and the value you are assigning to the property. body { color : blue } body is the Selector, color is the Declaration Property, blue is the Declaration Value. To set the background color of an element, class or id, is background-color. The following will set the background of a web page to yellow: body { background-color: yellow } To note: the declaration is enclosed within braces and the color symbol (:) separates the declaration property and the declaration value. CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 3 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 4

2 The color Property Inline CSS using the style attribute To configure the colour of text, use the color property. The following CSS rule will set the text color of a web page to be blue: body { color: blue } You can configure both background and text using the same rule selector by separating declarations is a semicolon (;): body { color: blue; background-color: yellow } Color can be any valid colour: aqua, black, blue, fuchsia, green, grey, lime maroon, navy, olive, purple, red, silver, teal, white, yellow. The most flexible way to specify color is by its numeric value (either hexadecimal, or RGB triplet in decimal). The style rule to create a soft yellow background #FFFFCC with medium blue text #3399CC is Recall that CSS can be inline, embedded, external and imported. An inline style is coded using an element s style attribute. Recall, a declaration consists of a property and a value separated by a colon (:). To set an <h1> tag to a shade of red: <h1 style= color:#cc0000">this is displayed as a red heading</h1> If there is more than one property, they are separated by a semicolon (;). For red text and a gray background: <h1 style= color:#cc0000; background-color:#cccccc;"> body { color:#3399cc; background-color:#ffffcc } CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 5 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 6 Inline CSS example Write another paragraphs and override the text color to dark gray: # To set the global style (i.e. for the entire page) set the style attribute in the body element: <body style="background-color:#f5f5f5;color:#008080;"> Example: <!DOCTYPE HTML> <html> <head> <title>inline CSS Example</title> <meta charset="utf-8"> </head> <body style="background-color:#f5f5f5;color:#008080;"> <h1 style="background-color:#008080;color:#f5f5f5;">inline CSS Example</h1> <p>this paragraph inherits the styles applied to the body tag.</p> </body> </html> Figure 1: Using inline CSS. CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 7 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 8

3 Using Embedded CSS Embedded styles apply to the entire document and are placed within a <style> element in the head section of a web page. The opening and closing <style>...</style> tags surround the embedded style rules. In XHTML you will see a type attribute for the style element. This is not required in HTML5. <head> <title>embedded CSS Example</title> <meta charset="utf-8"> <style> body { background-color: #E6E6FA; color: #191970; } h1 { background-color: #191970; color: #E6E6FA; } h2 { background-color: #AEAED4; color: #191970; } </style> </head> Figure 2: Embedded Styles CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 9 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 10 External CSS The <link> element The flexibility of CSS is best used when the CSS is external to the web page document. It s good to keep style (CSS) and structure (HTML) separate whenever possible! An external CSS style sheet is a text file (as HTML is a text file) but with a.css extension. Rather than HTML tags, it contains CSS rules. Since styles are in a single file, any modifications to the style of a webpage need only be done once, and to one single file (rather than to all the files making up the website!). The <link> element associates an external style sheet with a web page. It is placed in the head section of the page and is a stand-alone tag (singleton). <link> has 3 attributes: rel, href, and type 1. rel specifies the relationship between the current document and the linked document: stylesheet. 2. href specifies the location of the linked document: cssfilename.css 3. type specifies the type of file: text/css (optional for HTML5) The following is included in the head of an HTML document to associate it with the external style sheet named color.css <link rel="stylesheet" href="color.css"> TODO in class: create an external style sheet called color.css containing the following code: body { background-color:#00ffff;color:#ffffff; } CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 11 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 12

4 The Class Selector Configuring the Class Selector Use a CSS class selector when you need to apply a CSS declaration to a certain set of elements and not a particular element. As an example, you may want to highlight or emphasize items of a list in red (but not the whole list): CMPT 165 has 5 labs: <ol> <li>lab 1</li> <li>lab 2</li> <li>lab 3</li> <li>lab 4</li> <li>lab 5</li> <li>lab 6 (optional) </li> </ol> When setting a style for a class, configure the class name as the selector. For example, for the class name optional, place a period (.) in front of the class name in the style sheet:.optional { color: #FF0000; } The styles set in the new class can be applied to any element by using its class attribute: class="optional" To apply the style to the sixth list item: <li class="optional">lab 6 (optional)</li> NOTE: Only place the period in the class rule declaration (as defined in the CSS file) The sixth element is optional, so we may want it to stand out from the others, perhaps by making it red. CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 13 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 14 The Id Selector The Contextual Selector An id selector is used to apply a CSS rule uniquely to a single area on a web page. For example, to display the copyright information in dark gray (#333333). This could have been configured with a class, but since there is only one, an id is more appropriate. When setting a style for an id, place a hash mark (# in front of the id name in the style sheet. #footer { color: #333333; } The styles set in the footer id can be applied to any element you with by using the id attribute: id= footer. NOTE: the # only goes in the rule declaration. To apply to <div> tag: Use a contextual (or descendent) selector when you want to specify an element within the context of its container (parent) element. To configure a contextual selector, list the container selector (an element, id, or class) followed by the specific selector you are styling. To style the anchor tags located within the footer id, use the following: #footer a { color: fuchsia } Choose id and class names carefully! Though they must begin with a letter, numeral the dash, and the underscore can be used for additional letters. <div id="footer"> This paragraph will be diplayed using styles configure in the footer id.</div> CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 15 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 16

5 Span Element Margin between elements The <span>...</span> element defines a section on a wepage that is not physically separated from other areas by line breaks. Use the <span> tag when formatting an area contained within another, such as <p>, <blockquote>, <div>. In the style file configure the class:.coursename { color: maroon; } And in the HTML file, use the span as follows: Notice the empty space between the h1 element and the navigation area. It is the empty space between these two block-level elements. To collapse this space, configure the margin between the elements by adding the following style rule to the h1 element: margin-bottom: 0; If you want to specify a value other than 0 you must use the units (eg. unit of measure, percent or pixels). <p>in the course <span class="coursename"> CMPT 165: Introduction to the WWWW</span>, there will be 5 lab assignments: CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 17 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 18 Wireframes and Page Layout Page Layout Design Techniques A wireframe is a sketch or blueprint of a web page that show the structure but not the detailed design. As an example, you ll likely want to have a title or logo, a navigational area (where you have links to other areas on your site), content, and a footer. Heading Subheading... Title / Logo Navigation Content Footer Figure 3: The page layout in a wireframe. It s useful to create a wirefram to develop and experiment with ideas of page layout. The exact contact can be omitted. There are three popular techniques of web page layout design: ice, jello, and liquid. 1. Ice Design: (solid for fixed design), content is of fixed width, but arranged closer to the left margin. 2. Jello Design: content is either of fixed width OR a percentage width, and centered on the page with columns on both sides. 3. Liquid Design: content takes up to 100% of the browser window regardless of the screen resolution. A multicolumn content will flow to fill whaterver size of window is used to display it. WARNING: this may result in exceedingly long lines of text making it difficult to read! Jello designs are often used because the web pages are typically most pleasing to view on a variety of screen resolutions. CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 19 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 20

6 Creating a banner and other tips Configure Background Images Feel free to find web page banners/headers at the following URL: If the navigation area consists of images that may not display in some browsers, use an additional text-based navigational area in the footer. The background-image property can be used to configure a background image. For example body { background-image: url(spiderweb.png) } By default, this produces a background with a repeating image. Figure 4: A repeating background image. CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 21 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 22 The background-repeat property This property allows control over how the backgorund image will be repeated within the element. For example: repeat-x: repeat along the x-axis repeat-y: repeat along the y-axis For example, to repeat along the y-axis (vertical axis) NOTE: You can use both image and color to configure the background, so that the browser will display color in areas not covered by the image. body { background-color: #E2E2EF; color: #191970; background-image: url(spiderweb.png); background-repeat: repeat-y} Figure 5: Repeating background image along the y-axis CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 23 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 24

7 Positioning the Background image background-repeat: no-repeat; background-position: right, center; } You can specify the location of the background image besides the default top left corner using the background-position property. The background-position property can take on the following values: two percentages, pixel values or position values (left, top, center, bottom, right) with the two values being separated by a comma. The first value indicates the horizontal position The second value indicates the vertical position If only one value is provided the second defaults to center. Horizontal position: left right center, 0% -100% Vertical position: top center bottom, 0% -100% Example: background-position: right bottom; body { background-color: #E2E2EF; color: #191970; background-image: url(spiderweb.png); CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 25 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 26 Background attachment Adding space The background-attachment property configures whether the background image scrolls with the page or is fixed in the place: fixed, scroll (default). Try configure the following: h2 { color: #6A6AA7; background-image: url(spiderweb.png); background-repeat: no-repeat; } Notice the text appears over the image making it difficult to read. It would be nice to add space: To add space or padding: code the &nbsp about five times just after each opening <h2> tag OR, bettern, use the padding-left property (more on this later) to add empty space within the left-hand-side of the element. padding-left: 30px CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 27 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 28

8 Multiple Background Images The Favorites Icon Use the CSS background propertyto configure multiple backgroun images. Each declaration is separated by a comma. body{background-color: #E2E2EF; color: #191970; background-image: url(spiderweb.png); background: url (image1.png) no repeat botto url (image2.png); } The background property uses a shorthand notation: just list values needed for relevant properties. NOTE: not all browser s support multiple images. The favorites icon is the small icon you see in the address bar or tab of the browser (favicon). it is a square image (16X16 pixels) or (32X32 pixels) associated with a web page. See and configuring a favicon use the link element to link element to a webpage. file name should have.ico extension. <link rel="icon" href="favicon.ico" type="image/x-icon"> To be compatible with IE, you ll need to code a second link <link rel= shortcut icon href= favicon.ico type= image/x-icon > CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 29 CMPT 165: Introduction to the Internet and the WWW: Cascading Style Sheets 30

CMPT 165: More CSS Basics

CMPT 165: More CSS Basics CMPT 165: More CSS Basics Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University October 14, 2011 1 The Favorites Icon The favorites icon (favicon) is the small icon you see

More information

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model)

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model) INTRO TO CSS RECAP HTML WHAT IS CSS ADDING CSS TO YOUR HTML DOCUMENT CSS IN THE DIRECTORY TREE CSS RULES A FEW CSS VALUES (colour, size and the box model) CSS SELECTORS SPECIFICITY WEEK 1 HTML In Week

More information

Assignments (4) Assessment as per Schedule (2)

Assignments (4) Assessment as per Schedule (2) Specification (6) Readability (4) Assignments (4) Assessment as per Schedule (2) Oral (4) Total (20) Sign of Faculty Assignment No. 02 Date of Performance:. Title: To apply various CSS properties like

More information

Chapter 3 Style Sheets: CSS

Chapter 3 Style Sheets: CSS WEB TECHNOLOGIES A COMPUTER SCIENCE PERSPECTIVE JEFFREY C. JACKSON Chapter 3 Style Sheets: CSS 1 Motivation HTML markup can be used to represent Semantics: h1 means that an element is a top-level heading

More information

Appendix D CSS Properties and Values

Appendix D CSS Properties and Values HTML Appendix D CSS Properties and Values This appendix provides a brief review of Cascading Style Sheets (CSS) concepts and terminology, and lists CSS level 1 and 2 properties and values supported by

More information

Cascading Style Sheets Level 2

Cascading Style Sheets Level 2 Cascading Style Sheets Level 2 Course Objectives, Session 1 Level 1 Quick Review Chapter 6 Revisit: Web Fonts Chapter 8: Adding Graphics to Web Pages Chapter 9: Sprucing Up Your Site s Navigation Begin

More information

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB Unit 3 Cascading Style Sheets (CSS) Slides based on course material SFU Icons their respective owners 1 Learning Objectives In this unit you

More information

Reading 2.2 Cascading Style Sheets

Reading 2.2 Cascading Style Sheets Reading 2.2 Cascading Style Sheets By Multiple authors, see citation after each section What is Cascading Style Sheets (CSS)? Cascading Style Sheets (CSS) is a style sheet language used for describing

More information

CSS. Lecture 16 COMPSCI 111/111G SS 2018

CSS. Lecture 16 COMPSCI 111/111G SS 2018 CSS Lecture 16 COMPSCI 111/111G SS 2018 No CSS Styles A style changes the way the HTML code is displayed Same page displayed using different styles http://csszengarden.com Same page with a style sheet

More information

WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5

WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 LEARNING OUTCOMES In this chapter, you will learn how to... Describe the evolution of style sheets from print media to the Web List

More information

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1 Make a Website A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1 Overview Course outcome: You'll build four simple websites using web

More information

CSS Lecture 16 COMPSCI 111/111G SS 2018

CSS Lecture 16 COMPSCI 111/111G SS 2018 No CSS CSS Lecture 16 COMPSCI 111/111G SS 2018 Styles Astyle changes the way the HTML code is displayed Same page displayed using different styles Same page with a style sheet body font-family: sans-serif;

More information

CHAPTER 4 CASCADING STYLE SHEETS BASICS KEY CONCEPTS

CHAPTER 4 CASCADING STYLE SHEETS BASICS KEY CONCEPTS BASICS OF WEB DESIGN CHAPTER 4 CASCADING STYLE SHEETS BASICS KEY CONCEPTS 1 LEARNING OUTCOMES Describe the purpose of Cascading Style Sheets List advantages of using Cascading Style Sheets Configure color

More information

Web Development & Design Foundations with HTML5

Web Development & Design Foundations with HTML5 Web Development & Design Foundations with HTML5 KEY CONCEPTS Copyright Terry Felke-Morris 1 Learning Outcomes In this chapter, you will learn how to... Describe the evolution of style sheets from print

More information

BIM222 Internet Programming

BIM222 Internet Programming BIM222 Internet Programming Week 7 Cascading Style Sheets (CSS) Adding Style to your Pages Part II March 20, 2018 Review: What is CSS? CSS stands for Cascading Style Sheets CSS describes how HTML elements

More information

Web Development & Design Foundations with HTML5

Web Development & Design Foundations with HTML5 1 Web Development & Design Foundations with HTML5 CHAPTER 3 CSS BASICS Copyright Terry Felke-Morris 2 Learning Outcomes In this chapter, you will learn how to... Describe the evolution of style sheets

More information

Controlling Appearance the Old Way

Controlling Appearance the Old Way Webpages and Websites CSS Controlling Appearance the Old Way Older webpages use predefined tags - - italic text; - bold text attributes - Tables (and a few other elements) use specialized

More information

<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

<body bgcolor=  fgcolor=  link=  vlink=  alink= > These body attributes have now been deprecated, and should not be used in XHTML. CSS Formatting Background When HTML became popular among users who were not scientists, the limited formatting offered by the built-in tags was not enough for users who wanted a more artistic layout. Netscape,

More information

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference Inline Style Syntax: Introduction to Web Design CSS Reference Example: text Internal Style Sheet Syntax: selector {property: value; Example:

More information

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference Inline Style Syntax: Introduction to Web Design CSS Reference Example: text Internal Style Sheet Syntax: selector {property: value; Example:

More information

ICT IGCSE Practical Revision Presentation Web Authoring

ICT IGCSE Practical Revision Presentation Web Authoring 21.1 Web Development Layers 21.2 Create a Web Page Chapter 21: 21.3 Use Stylesheets 21.4 Test and Publish a Website Web Development Layers Presentation Layer Content layer: Behaviour layer Chapter 21:

More information

CSS for Styling CS380

CSS for Styling CS380 1 CSS for Styling The good, the bad and the 2 ugly! shashdot. News for nerds!! You will never, ever be bored here!

More information

CSS: The Basics CISC 282 September 20, 2014

CSS: The Basics CISC 282 September 20, 2014 CSS: The Basics CISC 282 September 20, 2014 Style Sheets System for defining a document's style Used in many contexts Desktop publishing Markup languages Cascading Style Sheets (CSS) Style sheets for HTML

More information

Introduction to HTML & CSS. Instructor: Beck Johnson Week 2

Introduction to HTML & CSS. Instructor: Beck Johnson Week 2 Introduction to HTML & CSS Instructor: Beck Johnson Week 2 today Week One review and questions File organization CSS Box Model: margin and padding Background images and gradients with CSS Make a hero banner!

More information

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student Welcome Please sit on alternating rows powered by lucid & no.dots.nl/student HTML && CSS Workshop Day Day two, November January 276 powered by lucid & no.dots.nl/student About the Workshop Day two: CSS

More information

CSS Cascading Style Sheets

CSS Cascading Style Sheets CSS Cascading Style Sheets site root index.html about.html services.html stylesheet.css images boris.jpg Types of CSS External Internal Inline External CSS An external style sheet is a text document with

More information

- The CSS1 specification was developed in CSSs provide the means to control and change presentation of HTML documents

- The CSS1 specification was developed in CSSs provide the means to control and change presentation of HTML documents 3.1 Introduction - The CSS1 specification was developed in 1996 - CSS2 was released in 1998 - CSS3 is on its way - CSSs provide the means to control and change presentation of HTML documents - CSS is not

More information

Review Question 1. Which tag is used to create a link to another page? 1. <p> 2. <li> 3. <a> 4. <em>

Review Question 1. Which tag is used to create a link to another page? 1. <p> 2. <li> 3. <a> 4. <em> Introduction to CSS Review Question 1 Which tag is used to create a link to another page? 1. 2. 3. 4. Review Question 1 Which tag is used to create a link to another page? 1. 2.

More information

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2)

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2) Web Development & Design Foundations with HTML5 Ninth Edition Chapter 3 Configuring Color and Text with CSS Slides in this presentation contain hyperlinks. JAWS users should be able to get a list of links

More information

CSS. https://developer.mozilla.org/en-us/docs/web/css

CSS. https://developer.mozilla.org/en-us/docs/web/css CSS https://developer.mozilla.org/en-us/docs/web/css http://www.w3schools.com/css/default.asp Cascading Style Sheets Specifying visual style and layout for an HTML document HTML elements inherit CSS properties

More information

**Method 3** By attaching a style sheet to your web page, and then placing all your styles in that new style sheet.

**Method 3** By attaching a style sheet to your web page, and then placing all your styles in that new style sheet. CSS Tutorial Part 1: Introduction: CSS adds style to tags in your html page. With HTML you told the browser what things were (e.g., this is a paragraph). Now you are telling the browser how things look

More information

Styles, Style Sheets, the Box Model and Liquid Layout

Styles, Style Sheets, the Box Model and Liquid Layout Styles, Style Sheets, the Box Model and Liquid Layout This session will guide you through examples of how styles and Cascading Style Sheets (CSS) may be used in your Web pages to simplify maintenance of

More information

ITNP43: HTML Lecture 4

ITNP43: HTML Lecture 4 ITNP43: HTML Lecture 4 Niederst, Part III (3rd edn) 1 Style versus Content HTML purists insist that style should be separate from content and structure HTML was only designed to specify the structure and

More information

What is the Box Model?

What is the Box Model? CSS Box Model What is the Box Model? The box model is a tool we use to understand how our content will be displayed on a web page. Each HTML element appearing on our page takes up a "box" or "container"

More information

3.1 Introduction. 3.2 Levels of Style Sheets. - HTML is primarily concerned with content, rather than style. - There are three levels of style sheets

3.1 Introduction. 3.2 Levels of Style Sheets. - HTML is primarily concerned with content, rather than style. - There are three levels of style sheets 3.1 Introduction - HTML is primarily concerned with content, rather than style - However, tags have presentation properties, for which browsers have default values - The CSS1 cascading style sheet specification

More information

CSC 443: Web Programming

CSC 443: Web Programming 1 CSC 443: Web Programming Haidar Harmanani Department of Computer Science and Mathematics Lebanese American University Byblos, 1401 2010 Lebanon CSC443: Web Programming 2 for Styling The good, the bad

More information

Introduction to Cascading Style Sheets

Introduction to Cascading Style Sheets Introduction to Cascading Style Sheets Welcome to the CSS workshop! Before you begin this workshop you should have some basic understanding of HTML and building web pages. What is CSS anyway and what will

More information

What is CSS? NAME: INSERT OPENING GRAPHIC HERE:

What is CSS? NAME: INSERT OPENING GRAPHIC HERE: What is CSS? NAME: INSERT OPENING GRAPHIC HERE: Highlight VOCABULARY WORDS that you need defined. Put a? mark in any area that you need clarified. 1 What is CSS? CSS stands for Cascading Style Sheets Styles

More information

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

Downloads: Google Chrome Browser (Free) -   Adobe Brackets (Free) - Week One Tools The Basics: Windows - Notepad Mac - Text Edit Downloads: Google Chrome Browser (Free) - www.google.com/chrome/ Adobe Brackets (Free) - www.brackets.io Our work over the next 6 weeks will

More information

CSS is applied to an existing HTML web document--both working in tandem to display web pages.

CSS is applied to an existing HTML web document--both working in tandem to display web pages. CSS Intro Introduction to Cascading Style Sheets What is CSS? CSS (Cascading Style Sheets) is a supplementary extension to allowing web designers to style specific elements on their pages and throughout

More information

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links Using Dreamweaver CC 4 Creating a Template Now that the main page of our website is complete, we need to create the rest of the pages. Each of them will have a layout that follows the plan shown below.

More information

- HTML is primarily concerned with content, rather than style. - However, tags have presentation properties, for which browsers have default values

- HTML is primarily concerned with content, rather than style. - However, tags have presentation properties, for which browsers have default values 3.1 Introduction - HTML is primarily concerned with content, rather than style - However, tags have presentation properties, for which browsers have default values - The CSS1 cascading style sheet specification

More information

Cascading Style Sheet Quick Reference

Cascading Style Sheet Quick Reference Computer Technology 8/9 Cascading Style Sheet Quick Reference Properties Properties are listed in alphabetical order. Each property has examples of possible values. Properties are not listed if they are

More information

ID1354 Internet Applications

ID1354 Internet Applications ID1354 Internet Applications CSS Leif Lindbäck, Nima Dokoohaki leifl@kth.se, nimad@kth.se SCS/ICT/KTH What is CSS? - Cascading Style Sheets, CSS provide the means to control and change presentation of

More information

CSS Box Model. Cascading Style Sheets

CSS Box Model. Cascading Style Sheets CSS Box Model Cascading Style Sheets CSS box model Background Width & height Margins & padding Borders Centering content Changing display type (block vs. inline) The Box Model Background Properties Property

More information

CSS Tutorial Part 1: Introduction: A. Adding Style to a Web Page (3 options):

CSS Tutorial Part 1: Introduction: A. Adding Style to a Web Page (3 options): CSS Tutorial Part 1: Introduction: CSS adds style to tags in your html page. With HTML you told the browser what things were (e.g., this is a paragraph). Now you are telling the browser how things look

More information

INFORMATICA GENERALE 2014/2015 LINGUAGGI DI MARKUP CSS

INFORMATICA GENERALE 2014/2015 LINGUAGGI DI MARKUP CSS INFORMATICA GENERALE 2014/2015 LINGUAGGI DI MARKUP CSS cristina gena dipartimento di informatica cgena@di.unito.it http://www.di.unito.it/~cgena/ materiale e info sul corso http://www.di.unito.it/~cgena/teaching.html

More information

Shane Gellerman 10/17/11 LIS488 Assignment 3

Shane Gellerman 10/17/11 LIS488 Assignment 3 Shane Gellerman 10/17/11 LIS488 Assignment 3 Background to Understanding CSS CSS really stands for Cascading Style Sheets. It functions within an HTML document, so it is necessary to understand the basics

More information

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6 CS 350 COMPUTER/HUMAN INTERACTION Lecture 6 Setting up PPP webpage Log into lab Linux client or into csserver directly Webspace (www_home) should be set up Change directory for CS 350 assignments cp r

More information

ICT IGCSE Practical Revision Presentation Web Authoring

ICT IGCSE Practical Revision Presentation Web Authoring 21.1 Web Development Layers 21.2 Create a Web Page Chapter 21: 21.3 Use Stylesheets 21.4 Test and Publish a Website Web Development Layers Presentation Layer Content layer: Behaviour layer Chapter 21:

More information

HTML-5.com itemscopehttp://data-vocabulary.org/breadcrumb<span itemprop="title">html 5</span> itemscopehttp://data-vocabulary.

HTML-5.com itemscopehttp://data-vocabulary.org/breadcrumb<span itemprop=title>html 5</span> itemscopehttp://data-vocabulary. HTML-5.com HTML-5.com is an HTML User's Guide and quick reference of HTML elements and attributes for web developers who code HTML web pages, not only for HTML 5 but for HTML coding in general, with demos

More information

CSS Selectors. element selectors. .class selectors. #id selectors

CSS Selectors. element selectors. .class selectors. #id selectors CSS Selectors Patterns used to select elements to style. CSS selectors refer either to a class, an id, an HTML element, or some combination thereof, followed by a list of styling declarations. Selectors

More information

Block & Inline Elements

Block & Inline Elements Block & Inline Elements Every tag in HTML can classified as a block or inline element. > Block elements always start on a new line (Paragraph, List items, Blockquotes, Tables) > Inline elements do not

More information

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1 CREATING A WEBSITE USING CSS Mrs. Procopio CTEC6 MYP1 HTML VS. CSS HTML Hypertext Markup Language CSS Cascading Style Sheet HTML VS. CSS HTML is used to define the structure and content of a webpage. CSS

More information

HTML/XML. HTML Continued Introduction to CSS

HTML/XML. HTML Continued Introduction to CSS HTML/XML HTML Continued Introduction to CSS Entities Special Characters Symbols such as +, -, %, and & are used frequently. Not all Web browsers display these symbols correctly. HTML uses a little computer

More information

INTRODUCTION TO CSS. Mohammad Jawad Kadhim

INTRODUCTION TO CSS. Mohammad Jawad Kadhim INTRODUCTION TO CSS Mohammad Jawad Kadhim WHAT IS CSS Like HTML, CSS is an interpreted language. When a web page request is processed by a web server, the server s response can include style sheets,

More information

Using Dreamweaver CS6

Using Dreamweaver CS6 Using Dreamweaver CS6 4 Creating a Template Now that the main page of our website is complete, we need to create the rest of the pages. Each of them will have a layout that follows the plan shown below.

More information

Cascading Style Sheets (CSS)

Cascading Style Sheets (CSS) Cascading Style Sheets (CSS) Mendel Rosenblum 1 Driving problem behind CSS What font type and size does introduction generate? Answer: Some default from the browser (HTML tells what browser how)

More information

To link to an external stylesheet, the link element is placed within the head of the html page:

To link to an external stylesheet, the link element is placed within the head of the html page: CSS Basics An external style sheet is simply a text file (use BBEdit or Textwrangler) containing style rules, saved with the.css extension. It s best practice to keep style sheets for a site grouped within

More information

Cascade Stylesheets (CSS)

Cascade Stylesheets (CSS) Previous versions: David Benavides and Amador Durán Toro (noviembre 2006) Last revision: Manuel Resinas (october 2007) Tiempo: 2h escuela técnica superior de ingeniería informática Departamento de Lenguajes

More information

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 2

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 2 Web Programming and Design MPT Senior Cycle Tutor: Tamara Week 2 Plan for the next 4 weeks: Introduction to HTML tags, creating our template file Introduction to CSS and style Introduction to JavaScript

More information

Web Site Design and Development Lecture 5

Web Site Design and Development Lecture 5 Web Site Design and Development Lecture 5 CS 0134 Fall 2018 Tues and Thurs 1:00 2:15PM CSS CSS stands for Cascading Style Sheets. These style sheets define the look and layout of your HTML elements. A

More information

CSS: Cascading Style Sheets

CSS: Cascading Style Sheets What are Style Sheets CSS: Cascading Style Sheets Representation and Management of Data on the Internet, CS Department, Hebrew University, 2007 A style sheet is a mechanism that allows to specify how HTML

More information

Introduction to using HTML to design webpages

Introduction to using HTML to design webpages Introduction to using HTML to design webpages #HTML is the script that web pages are written in. It describes the content and structure of a web page so that a browser is able to interpret and render the

More information

INTERNATIONAL UNIVERSITY OF JAPAN Public Management and Policy Analysis Program Graduate School of International Relations

INTERNATIONAL UNIVERSITY OF JAPAN Public Management and Policy Analysis Program Graduate School of International Relations Hun Myoung Park (1/26/2019) Cascading Style Sheets: 1 INTERNATIONAL UNIVERSITY OF JAPAN Public Management and Policy Analysis Program Graduate School of International Relations ADC5030401 (2 Credits) Introduction

More information

CSS Cascading Style Sheets

CSS Cascading Style Sheets CSS Cascading Style Sheets site root index.html about.html services.html stylesheet.css charlie.jpg Linking to your HTML You need to link to your css in the of your HTML file.

More information

Tutorial 3: Working with Cascading Style Sheets

Tutorial 3: Working with Cascading Style Sheets Tutorial 3: Working with Cascading Style Sheets College of Computing & Information Technology King Abdulaziz University CPCS-665 Internet Technology Objectives Review the history and concepts of CSS Explore

More information

IDM 221. Web Design I. IDM 221: Web Authoring I 1

IDM 221. Web Design I. IDM 221: Web Authoring I 1 IDM 221 Web Design I IDM 221: Web Authoring I 1 Week 4 IDM 221: Web Authoring I 2 Presenta(on IDM 221: Web Authoring I 3 Up until this point everything we've focused on has been related to content, and

More information

Dreamweaver CS3 Lab 2

Dreamweaver CS3 Lab 2 Dreamweaver CS3 Lab 2 Using an External Style Sheet in Dreamweaver Creating the site definition First, we'll set up the site and define it so that Dreamweaver understands the site structure for your project.

More information

Intermediate Web Publishing: Working with Styles

Intermediate Web Publishing: Working with Styles Intermediate Web Publishing: Working with Styles Jeff Pankin Information Services & Technology Contents Introduction... 2 In this class you will:... 2 Set the Preferences... 2 General... 2 Invisible Elements...

More information

Web Engineering CSS. By Assistant Prof Malik M Ali

Web Engineering CSS. By Assistant Prof Malik M Ali Web Engineering CSS By Assistant Prof Malik M Ali Overview of CSS CSS : Cascading Style Sheet a style is a formatting rule. That rule can be applied to an individual tag element, to all instances of a

More information

HTML + CSS. ScottyLabs WDW. Overview HTML Tags CSS Properties Resources

HTML + CSS. ScottyLabs WDW. Overview HTML Tags CSS Properties Resources HTML + CSS ScottyLabs WDW OVERVIEW What are HTML and CSS? How can I use them? WHAT ARE HTML AND CSS? HTML - HyperText Markup Language Specifies webpage content hierarchy Describes rough layout of content

More information

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style precedence and style inheritance Understand the CSS use

More information

Admin. Midterm 1 on. Oct. 13 th (2 weeks from today) Coursework:

Admin. Midterm 1 on. Oct. 13 th (2 weeks from today) Coursework: Midterm 1 on Admin Oct. 13 th (2 weeks from today) Coursework: E1 grade released: please see Karoon (TA) at his office hours (Tues at 12-1pm) E2 due tomorrow E3 posted yesterday; due this Friday 11:59pm

More information

COMS 359: Interactive Media

COMS 359: Interactive Media COMS 359: Interactive Media Agenda Review CSS Preview Review Transparent GIF headline Review JPG buttons button1.jpg button.psd button2.jpg Review Next Step Tables CSS Introducing CSS What is CSS? Cascading

More information

Overview. Part I: Portraying the Internet as a collection of online information systems HTML/XHTML & CSS

Overview. Part I: Portraying the Internet as a collection of online information systems HTML/XHTML & CSS CSS Overview Part I: Portraying the Internet as a collection of online information systems Part II: Design a website using HTML/XHTML & CSS XHTML validation What is wrong?

More information

3. Each of these mark examples contains an error. a. <input name= country value= Your country here. /> b. <checkbox name= color value= teal />

3. Each of these mark examples contains an error. a. <input name= country value= Your country here. /> b. <checkbox name= color value= teal /> 1. Decide whether each of these forms should be sent via the GET or POST method: A form for accessing your bank account online A form for sending t-shirt artwork to the printer A form for searching archived

More information

Client-Side Web Technologies. CSS Part I

Client-Side Web Technologies. CSS Part I Client-Side Web Technologies CSS Part I Topics Style declarations Style sources Selectors Selector specificity The cascade and inheritance Values and units CSS Cascading Style Sheets CSS specifies the

More information

Module 2 (VII): CSS [Part 4]

Module 2 (VII): CSS [Part 4] INTERNET & WEB APPLICATION DEVELOPMENT SWE 444 Fall Semester 2008-2009 (081) Module 2 (VII): CSS [Part 4] Dr. El-Sayed El-Alfy Computer Science Department King Fahd University of Petroleum and Minerals

More information

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets 3.1 Introduction - The CSS1 specification was developed in 1996 - CSS2 was released in 1998 - CSS2.1 reflects browser implementations - CSS3 is partially finished and parts are implemented in current browsers

More information

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations 3.1 Introduction - The CSS1 specification was developed in 1996 - CSS2 was released in 1998 - CSS2.1 reflects browser implementations - CSS3 is partially finished and parts are implemented in current browsers

More information

INTRODUCTION TO HTML5! CSS Styles!

INTRODUCTION TO HTML5! CSS Styles! INTRODUCTION TO HTML5! CSS Styles! Understanding Style Sheets HTML5 enables you to define many different types of content on a web page, including headings, paragraphs, lists, images, input fields, canvases,

More information

Using Dreamweaver. 6 Styles in Websites. 1. Linked or Imported Stylesheets. 2. Embedded Styles. 3. Inline Styles

Using Dreamweaver. 6 Styles in Websites. 1. Linked or Imported Stylesheets. 2. Embedded Styles. 3. Inline Styles Using Dreamweaver 6 So far these exercises have deliberately avoided using HTML s formatting options such as the FONT tag. This is because the basic formatting available in HTML has been made largely redundant

More information

.hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in; } .tube {

.hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in; } .tube { .hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in;.tube { color: #996600; height: 3in; width: 12in; position: fixed; What is CSS? Cascading Style Sheets CSS is responsible

More information

CISC1600-SummerII2012-Raphael-lec3 1

CISC1600-SummerII2012-Raphael-lec3 1 CISC 1600 Introduction to Multi-media Computing Agenda Email Address: Course Page: Class Hours: Summer Session II 2012 Instructor : J. Raphael raphael@sci.brooklyn.cuny.edu http://www.sci.brooklyn.cuny.edu/~raphael/cisc1600.html

More information

2005 WebGUI Users Conference

2005 WebGUI Users Conference Cascading Style Sheets 2005 WebGUI Users Conference Style Sheet Types 3 Options Inline Embedded Linked Inline Use an inline style sheet to modify a single element one time in a page.

More information

Dreamweaver CS5 Lab 2

Dreamweaver CS5 Lab 2 Dreamweaver CS5 Lab 2 Using an External Style Sheet in Dreamweaver Creating the site definition First, we'll set up the site and define it so that Dreamweaver understands the site structure for your project.

More information

FrontPage 2000 Tutorial -- Advanced

FrontPage 2000 Tutorial -- Advanced FrontPage 2000 Tutorial -- Advanced Shared Borders Shared Borders are parts of the web page that share content with the other pages in the web. They are located at the top, bottom, left side, or right

More information

8a. Cascading Style Sheet

8a. Cascading Style Sheet INFS 2150 Introduction to Web Development 8a. Cascading Style Sheet 1 Objectives Concepts of cascading style sheets (CSS). 3 ways of using CSS: inline styles, embedded styles, and external style sheet.

More information

Programmazione Web a.a. 2017/2018 HTML5

Programmazione Web a.a. 2017/2018 HTML5 Programmazione Web a.a. 2017/2018 HTML5 PhD Ing.Antonino Raucea antonino.raucea@dieei.unict.it 1 Introduzione HTML HTML is the standard markup language for creating Web pages. HTML stands for Hyper Text

More information

Introduction to WEB PROGRAMMING

Introduction to WEB PROGRAMMING Introduction to WEB PROGRAMMING Web Languages: Overview HTML CSS JavaScript content structure look & feel transitions/animation s (CSS3) interaction animation server communication Full-Stack Web Frameworks

More information

How to Control and Override CSS by Including a CSS Link

How to Control and Override CSS by Including a CSS Link How to Control and Override CSS by Including a CSS Link Using CSS Includes User Documentation for OU By Lucero, 6-25-2014 CSS styles and definitions can be overwritten and subsequently controlled and defined

More information

HIERARCHICAL ORGANIZATION

HIERARCHICAL ORGANIZATION A clearly defined home page Navigation links to major site sections HIERARCHICAL ORGANIZATION Often used for commercial and corporate websites 1 Repetition DESIGN PRINCIPLES Repeat visual elements throughout

More information

Fundamentals of Web Programming a

Fundamentals of Web Programming a Fundamentals of Web Programming a Cascading Style Sheets Teodor Rus rus@cs.uiowa.edu The University of Iowa, Department of Computer Science a Copyright 2009 Teodor Rus. These slides have been developed

More information

Scripting for Multimedia LECTURE 5: INTRODUCING CSS3

Scripting for Multimedia LECTURE 5: INTRODUCING CSS3 Scripting for Multimedia LECTURE 5: INTRODUCING CSS3 CSS introduction CSS Level 1 --> CSS Level 2 --> CSS Level 3 (in modules) More than 50 modules are published Cascading style sheets (CSS) defines how

More information

COMS 359: Interactive Media

COMS 359: Interactive Media COMS 359: Interactive Media Agenda Review CSS Layout Preview Review Introducting CSS What is CSS? CSS Syntax Location of CSS The Cascade Box Model Box Structure Box Properties Review Style is cascading

More information

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo Note: We skipped Study Guide 1. If you d like to review it, I place a copy here: https:// people.rit.edu/~nbbigm/studyguides/sg-1.docx

More information

CSS

CSS http://www.flickr.com/photos/baylorbear78/3406180116/ CSS 2 OVERVIEW OF CSS HTML is about content and structure (semantics) What is the content? How is the content related to other content? CSS is all

More information

CSS FOUNDATIONS IN-DEPTH. The nitty-gritty of css...

CSS FOUNDATIONS IN-DEPTH. The nitty-gritty of css... CSS FOUNDATIONS IN-DEPTH The nitty-gritty of css... What is CSS? Cascading Style Sheets Style sheets define formatting rules that are applied to text, images, forms, and embedded and layout elements. A

More information

Using Dreamweaver CS6

Using Dreamweaver CS6 6 So far we have used CSS to arrange the elements on our web page. We have also used CSS for some limited formatting. In this section we will take full advantage of using CSS to format our web site. Just

More information