Introduction to Computer Science Web Development

Size: px
Start display at page:

Download "Introduction to Computer Science Web Development"

Transcription

1 Introduction to Computer Science Web Development Flavio Esposito Lecture 9

2 Lecture Outline Text Styling Some useful CSS properties The Box Model essential to navigate around CSS Browser Developer Tools Chrome or FireBug plugin in Firefox

3 Lecture Outline Text Styling Some useful CSS properties The Box Model essential to navigate around CSS Browser Developer Tools Chrome or FireBug plugin in Firefox

4 Styling Test Let s cover a few useful ways to style text Start from here: styling/styling- text- before.html

5 Common Text Styling <body> <style>.style { font- family: Arial, Helvetica, sans- serif; Why three? } </style> </body>

6 Common Text Styling <body> <style>.style { font- family: Arial, Helvetica, sans- serif; color: #0000ff; Good idea to pick exactly the color we want with hex code } </style> </body>

7 Common Text Styling <body> <style>.style { font- family: Arial, Helvetica, sans- serif; color: #0000ff; font- style: italic; } </style> </body>

8 Common Text Styling <body> <style>.style { font- family: Arial, Helvetica, sans- serif; color: #0000ff; font- style: italic; font- weight: bold; font- size: 24px; /* points (pt) are used in print, not screen.*/ } </style> </body>

9 Common Text Styling <body> <style>.style { } </style> </body> font- family: Arial, Helvetica, sans- serif; color: #0000ff; font- style: italic; font- weight: bold; font- size: 24px; /* points (pt) are used in print, not screen.*/ text- transform: uppercase; text- align: right;

10 Relative Font Sizing Consider this file, and let s apply some fonts to it Start from here: styling/font- size- before.html

11 Relative Font Size have queuing effect and do not overwrite <body><style> body { font- size: 120%; } </style></head> <body> <div>regular text</div> <div>2em text <div>4em text <div>2em again! </div> </div> </div> </body> </style> </body>

12 Relative Font Size have queuing effect and do not overwrite <body><style> body { font- size: 120%; } </style></head> <body> <div>regular text</div> <div style="font- size: 2em;">2em text <div style="font- size: 2em;">4em text <div>2em again! </div> </div> </div> </body> </style> </body>

13 How do you revert it? <body><style> body { font- size: 120%; } </style></head> <body> <div>regular text</div> <div style="font- size: 2em;">2em text <div style="font- size: 2em;">4em text <div style="font- size:.5em;">2em again! </div> </div> </div> </body> Try to zoom the HTML page! </style> </body>

14 Not a good idea to mix % and em <body><style> CSS will be hard to debug body { font- size: 120%; } if we mix % and em </style></head> <body> <div>regular text</div> <div style="font- size: 2em;">2em text <div style="font- size: 2em;">4em text <div style="font- size:.5em;">2em again! </div> </div> </div> </body> </style> </body>

15 Question to test your new skill Given the following HTML code: <head> <style> </style> </head> <body> </body> </style> </body> body {font- size: 30px;} <div style="font- size: 3em;">How many px?</div> What is the pixel size of the text "How many px?", assuming the user did NOT increase zoom in the browser window?

16 Question to test your new skill Given the following HTML code: <head> <style> </style> </head> <body> </body> </style> </body> body {font- size: 30px;} Hint: _90px _30px _3px <div style="font- size: 3em;">How many px?</div> What is the pixel size of the text "How many px?", assuming the user did NOT increase zoom in the browser window?

17 Question to test your new skill Given the following HTML code: <head> <style> </style> </head> <body> </body> </style> </body> body {font- size: 30px;} _90px _30px _3px <div style="font- size: 3em;">How big am I?</div> What is the pixel size of the text "How many px?", assuming the user did NOT increase zoom in the browser window?

18 Lecture Outline Text Styling Some useful CSS properties The Box Model essential to navigate around CSS Browser Developer Tools Chrome or FireBug plugin in Firefox

19 The Box Model In HTML every element is considered a BOX Content

20 The Box Model (from in to out) Content - The content of the box, where text and images appear Padding- Clears an area around the content. The padding is transparent Border - A border that goes around the padding and content Margin - Clears an area outside the border. The margin is transparent

21 Let s look at some examples <head><meta charset="utf- 8"><title>The Box Model</title> <style> body { background- color: gray;} #box { background- color: blue;} #content { background- color: #90EE90; /*green*/} h1 { margin- bottom: 30px;} </style> </head> <body> <h1>box Model</h1> <div id="box"> <div id="content">lorem ipsum </div> </div> </body> boxmodel/box- model- before.html

22 Let s look at some examples boxmodel/box- model- before.html - Download html page, - open it with a browser and and editor - follow along

23 Let s analyze the example page <head><meta charset="utf- 8"><title>The Box Model</title> <style> body { background- color: gray;} #box { background- color: blue;} #content { background- color: #90EE90; /*green*/} h1 { margin- bottom: 30px;} </style> </head> <body> <h1>box Model</h1> <div id="box"> <div id="content">lorem ipsum </div> </div> </body>

24 Try the browser developer tool Inspect the body element The body tag has a margin of 8px Where is this margin coming from? user agent style default browser style How do we reset the default browser style?

25 Reset default browser style Inspect the body element The body tag has a margin of 8px Where is this margin coming from? user agent style default browser style How do we reset the default browser style? body { } background- color: gray; margin: 0px; padding: 0px;

26 The blue of #box is being overwritten by #content green! <head><meta charset="utf- 8"><title>The Box Model</title> <style> body { } #box { background- color: blue;} #content { background- color: #90EE90; /*green*/} h1 { margin- bottom: 30px;} </style> </head> <body> <h1>box Model</h1> <div id="box"> <div id="content">lorem ipsum </div> </div> </body>

27 Let s make the blue #box visible Let s add some padding: #box { } background- color: blue; padding: 10px 10px 10px 10px; /* right bottom left top (clockwise) */ /* padding: 10px is equivalent */ #content { background- color: #90EE90; /*green*/} h1 { margin- bottom: 30px;} </style>

28 Let s make the blue #box visible Let s add some border and margin: #box { } background- color: blue; padding: 10px 10px 10px 10px; /* right bottom left top */ /* padding: 10px is equivalent */ border: 5px solid black; margin: 40px; #content { background- color: #90EE90; /*green*/} h1 { margin- bottom: 30px;} </style>

29 Let s make the blue #box visible Let s add some width to the box: #box { } background- color: blue; padding: 10px; border: 5px solid black; margin: 40px; width: 300px; //changing this will adjust the box Is it really 300 px????!?!?! try change border or padding again

30 How do we set the width of the box and not the content? (box model definition) Awesome Secret CSS3 magic trick!!! #box { } background- color: blue; padding: 10px; border: 5px solid black; margin: 40px; width: 300px; // is this boarder or content? box- sizing: boarder- box; /* CSS3 feature!!!*/ /* content- box; is the default value*/ Now the width is really forced to be 300! Make sure you use boarder- box in your layouts!

31 How do I specify boarder- box; once for all?

32 How do I specify boarder- box; once for all? Would it work if I set it in the body? Try! body { background- color: gray; box- sizing: boarder- box; } #box { } #content { } h1 { }

33 How do I specify boarder- box; once for all? Would it work if I set it in the body? Try? body { } background- color: gray; box- sizing: boarder- box; It didn t work. Why? It is NOT a property that can be inherited

34 So how do we apply a property like this to every element in the DOM tree (in an elegant way?)

35 Introducing the new STAR (*) selector Awesome Secret CSS2 magic STAR selector!!! * { } box- sizing: boarder- box; The STAR selector means: take every selector and apply these properties

36 So how do we apply a property like this to every element in the DOM tree (in an elegant way?) Awesome Secret CSS2 magic STAR selector!!! You are now a super- powerful CSS developer * { } box- sizing: boarder- box; The STAR selector means: take every selector and apply these properties

37 Does every browser support CSS2, CSS3? Let s check on: caniuse.com

38 Not every browser supports every CSS2, CSS3 feature: caniuse.com Let s check on: caniuse.com sizing

39 Something more about margins Left / Right margins are cumulative

40 Something more about margins Vertically, however, the larger margin wins (margins collapse)

41 Let s go back to our page <head><meta charset="utf- 8"><title>The Box Model</title> <style> body { background- color: gray;} #box { background- color: blue;} #content { background- color: #90EE90; /*green*/} h1 { margin- bottom: 30px;} </style> </head> <body> <h1>box Model</h1> <div id="box"> <div id="content">lorem ipsum </div> </div> </body>

42 Let s analyze the example page #box { } h1 { } background- color: blue; padding: 10px; border: 5px solid black; margin: 20px; /*this value is smaller than h1 50px below*/ width: 300px; margin- bottom: 30px; set #box margin to 20 - > h1 {margin- bottom: 30px;} wins (30px > 20px)

43 Let s analyze the example page #box { } h1 { } background- color: blue; padding: 10px; border: 5px solid black; margin: 50px; /*now this wins*/ width: 300px; margin- bottom: 30px; set #box margin to 20 - > h1 {margin- bottom: 30px;} wins (30px > 20px) set #box margin to 50 - > h1 {margin- bottom: 30px;} looses (50px > 20px)

44 Let s add more text to the content box <body> <h1>box Model</h1> <div id="box"> <div id="content">lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum </div> </div> </body> Now constraint the height of the #box

45 Let s add more text to the content box #box { } background- color: blue; padding: 10px; border: 5px solid black; margin: 50px; width: 300px; height: 20px; /*or lower so the content spills over the box*/ <body> <h1>box Model</h1> <div id="box"> <div id="content">lorem ipsum </div> </div> </body>

46 Overflow will fix that spill over! #box { } background- color: blue; padding: 10px; border: 5px solid black; margin: 50px; width: 300px; height: 20px; /*or lower so the content spills over the box*/ overflow: visible; /* visible is the default*/ overflow: hidden; /* cuts */ overflow: auto; /*scroll bar if needed*/ overflow: scroll; /*scroll bar always there */ Often scroll bar are really undesirable

47 Practice Quiz Assuming no other styles exist, how many pixels wide will the 'div' tag be with the following styles: div { } padding: 10px 10px 10px 10px; margin: 10px 10px 10px 10px; width: 100px; border: 10px solid black;

48 Practice Quiz Assuming no other styles exist, how many pixels wide will the 'div' tag be with the following styles: div { padding: 10px 10px 10px 10px; margin: 10px 10px 10px 10px; width: 100px; } border: 10px solid black; Hint: 140 px 160 px 200 px 100 px

49 Practice Quiz Assuming no other styles exist, how many pixels wide will the 'div' tag be with the following styles: div { } padding: 10px 10px 10px 10px; margin: 10px 10px 10px 10px; width: 100px; border: 10px solid black; Solution: 140 px 160 px Margins don't define the width of the box. 200 px They just define how far other elements should 100 px be pushed away from it.

50 Practice Quiz Assuming no other styles exist, how many pixels wide will the 'div' tag be with the following styles: div { } padding: 10px 10px 10px 10px; margin: 10px 10px 10px 10px; width: 100px; border: 10px solid black; box- sizing: border- box; Hint: 140 px 160 px 200 px 100 px

51 Practice Quiz Assuming no other styles exist, how many pixels wide will the 'div' tag be with the following styles: div { } padding: 10px 10px 10px 10px; margin: 10px 10px 10px 10px; width: 100px; border: 10px solid black; box- sizing: border- box; box- sizing: border- box was set, so the width of the box, including padding and border, will be constrained to the specified width: 100px. Solution: 140 px 160 px 200 px 100 px

52 Practice Quiz Given the following HTML code:... <div style="margin- bottom: 10px;">...</div> <div style="margin- top: 20px;">...</div> What will be the margin between the 2 'div' elements? Hint: 10 px 20 px 30 px 0

53 Practice Quiz Given the following HTML code:... <div style="margin- bottom: 10px;">...</div> <div style="margin- top: 20px;">...</div> What will be the margin between the 2 'div' elements? Vertical margins that touch collapse and the larger one wins. Solution: 10 px 20 px 30 px 0

54 Lecture Summary Relative Font Size have queuing effect and do not overwrite (120% vs 2em) Box Model is essential to navigate around CSS code prefer box- sizing: border- box The * (universal or star) selector Is a powerful selector when inheritance lacks Cumulative, Collapsing Margins and Overflow good to know when you are editing templates

55 Introduction to Computer Science Web Development Flavio Esposito Lecture 9

Introduction to Computer Science Web Development

Introduction to Computer Science Web Development Introduction to Computer Science Web Development Flavio Esposito http://cs.slu.edu/~esposito/teaching/1080/ Lecture 12 Lecture Outline Background property and subproperties Position Elements by Floating

More information

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster. Wanted! Introduction In this project, you ll learn how to make your own poster. Step 1: Styling your poster Let s start by editing the CSS code for the poster. Activity Checklist Open this trinket: jumpto.cc/web-wanted.

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

Adding CSS to your HTML

Adding CSS to your HTML Adding CSS to your HTML Lecture 3 CGS 3066 Fall 2016 September 27, 2016 Making your document pretty CSS is used to add presentation to the HTML document. We have seen 3 ways of adding CSS. In this lecture,

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

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

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

CSS: Cascading Style Sheets

CSS: Cascading Style Sheets CSS: Cascading Style Sheets Computer Science and Engineering College of Engineering The Ohio State University Lecture 13 Evolution of CSS MIME type: text/css CSS 1 ('96): early recognition of value CSS

More information

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100 Introduction to Multimedia MMP100 Spring 2016 profehagan@gmail.com thiserichagan.com/mmp100 Troubleshooting Check your tags! Do you have a start AND end tags? Does everything match? Check your syntax!

More information

Getting Started with Eric Meyer's CSS Sculptor 1.0

Getting Started with Eric Meyer's CSS Sculptor 1.0 Getting Started with Eric Meyer's CSS Sculptor 1.0 Eric Meyer s CSS Sculptor is a flexible, powerful tool for generating highly customized Web standards based CSS layouts. With CSS Sculptor, you can quickly

More information

Introduction to Computer Science Web Development

Introduction to Computer Science Web Development Introduction to Computer Science Web Development Flavio Esposito http://cs.slu.edu/~esposito/teaching/1080/ Lecture 14 Lecture outline Discuss HW Intro to Responsive Design Media Queries Responsive Layout

More information

ITSE 1401 Web Design Tools Lab Project 4 (Expression Web 4 - Units M, N, O, P) Last revised: 1/9/14

ITSE 1401 Web Design Tools Lab Project 4 (Expression Web 4 - Units M, N, O, P) Last revised: 1/9/14 (Expression Web 4 - Units M, N, O, P) Last revised: 1/9/14 Directions: Perform the tasks below on your personal computer or a lab computer. Professor Smith shows the score points for each activity in parentheses.

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

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

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

Fundamentals of Web Technologies. Agenda: CSS Layout (Box Model) CSS Layout: Box Model. All HTML elements can be considered as a box or a container

Fundamentals of Web Technologies. Agenda: CSS Layout (Box Model) CSS Layout: Box Model. All HTML elements can be considered as a box or a container ITU 07204: Fundamentals of Web Technologies Lecture 6: CSS Layouts (Intro) Dr. Lupiana, D FCIM, Institute of Finance Management Semester 2 Agenda: CSS Layout (Box Model) 2 CSS Layout: Box Model All HTML

More information

Lab 2: Movie Review. overview.png background.png rottenbig.png rbg.png fresh.gif rotten.gif critic.gif

Lab 2: Movie Review. overview.png background.png rottenbig.png rbg.png fresh.gif rotten.gif critic.gif EDUCATIONAL GOALS Lab 2: Movie Review By the end of this lab, the student should be able to: Use Notepad++. Organize website contents. Use the basic of CSS and HTML for layout, positioning, and the CSS

More information

Note: The screenshots in this document were taken on Windows in Firefox, which may differ from your system.

Note: The screenshots in this document were taken on Windows in Firefox, which may differ from your system. CSCI 366 (Database and Web Dev) Dr. Schwartz Lab 5: HTML and CSS (Adapted from Web Programming Step by Step) Due Monday, March 26 th at 11:59pm 100 pts total (69 pts Autolab) Introduction This assignment

More information

In the early days of the Web, designers just had the original 91 HTML tags to work with.

In the early days of the Web, designers just had the original 91 HTML tags to work with. Web Design Lesson 4 Cascading Style Sheets In the early days of the Web, designers just had the original 91 HTML tags to work with. Using HTML, they could make headings, paragraphs, and basic text formatting,

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

CSS worksheet. JMC 105 Drake University

CSS worksheet. JMC 105 Drake University CSS worksheet JMC 105 Drake University 1. Download the css-site.zip file from the class blog and expand the files. You ll notice that you have an images folder with three images inside and an index.html

More information

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148 Index Numbers & Symbols (angle brackets), in HTML, 47 : (colon), in CSS, 96 {} (curly brackets), in CSS, 75, 96. (dot), in CSS, 89, 102 # (hash mark), in CSS, 87 88, 99 % (percent) font size, in CSS,

More information

COSC 2206 Internet Tools. CSS Cascading Style Sheets

COSC 2206 Internet Tools. CSS Cascading Style Sheets COSC 2206 Internet Tools CSS Cascading Style Sheets 1 W3C CSS Reference The official reference is here www.w3.org/style/css/ 2 W3C CSS Validator You can upload a CSS file and the validator will check it

More information

CSS3 Basics. From & CSS Visual Dictionary Learning Curve Books, LLC

CSS3 Basics. From   & CSS Visual Dictionary Learning Curve Books, LLC CSS3 Basics From www.w3schools.com & CSS Visual Dictionary Learning Curve Books, LLC CSS Box Model Margin (top, right, bottom, left) Shorthand property, equivalent to Border-width border-style border-color

More information

HTML and CSS a further introduction

HTML and CSS a further introduction HTML and CSS a further introduction By now you should be familiar with HTML and CSS and what they are, HTML dictates the structure of a page, CSS dictates how it looks. This tutorial will teach you a few

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

Lab Introduction to Cascading Style Sheets

Lab Introduction to Cascading Style Sheets Lab Introduction to Cascading Style Sheets For this laboratory you will need a basic text editor and a browser. In the labs, winedt or Notepad++ is recommended along with Firefox/Chrome For this activity,

More information

Layout with Layers and CSS

Layout with Layers and CSS Layout with Layers and CSS Today we're going to make a Web site layout. Preparatory Step 1. Inside your folder create a new folder and name it layout. 2. Inside the layout folder create a new folder and

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

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

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

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

CSS. Shan-Hung Wu CS, NTHU

CSS. Shan-Hung Wu CS, NTHU CSS Shan-Hung Wu CS, NTHU CSS Zen Garden 2 Outline The Basics Selectors Layout Stacking Order 3 Outline The Basics Selectors Layout Stacking Order 4 Grammar selector { property: value; 5 Example /* for

More information

To illustrate how to set TAG styles the <body> and <h1> tags (for the BODY and the HEADING 1 styles) will be adjusted.

To illustrate how to set TAG styles the <body> and <h1> tags (for the BODY and the HEADING 1 styles) will be adjusted. Chapter The formatting of CSS pages is carried out by setting the required styles. There are four different types of styles: Class which are custom styles that you create. You did this in Chapter 12. Tag

More information

Stamp Builder. Documentation. v1.0.0

Stamp  Builder. Documentation.   v1.0.0 Stamp Email Builder Documentation http://getemailbuilder.com v1.0.0 THANK YOU FOR PURCHASING OUR EMAIL EDITOR! This documentation covers all main features of the STAMP Self-hosted email editor. If you

More information

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development INFS 2150 Introduction to Web Development 3. Page Layout Design Objectives Create a reset style sheet Explore page layout designs Center a block element Create a floating element Clear a floating layout

More information

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development Objectives INFS 2150 Introduction to Web Development 3. Page Layout Design Create a reset style sheet Explore page layout designs Center a block element Create a floating element Clear a floating layout

More information

Page Layout. 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning

Page Layout. 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning Page Layout contents of this presentation are Copyright 2009 Marty Stepp and Jessica Miller 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning 2 1 4.1

More information

Building Page Layouts

Building Page Layouts Building Page Layouts HTML & CSS From Scratch Slides 3.1 Topics Display Box Model Box Aesthetics Float Positioning Element Display working example at: h9ps://;nker.io/3a2bf Source: unknown. Please contact

More information

The Benefits of CSS. Less work: Change look of the whole site with one edit

The Benefits of CSS. Less work: Change look of the whole site with one edit 11 INTRODUCING CSS OVERVIEW The benefits of CSS Inheritance Understanding document structure Writing style rules Attaching styles to the HTML document The cascade The box model CSS units of measurement

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

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

Internet Programming 1 ITG 212 / A

Internet Programming 1 ITG 212 / A Internet Programming 1 ITG 212 / A Lecture 10: Cascading Style Sheets Page Layout Part 2 1 1 The CSS Box Model top margin top border top padding left margin left border left padding Content right padding

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

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

Introduction to Computer Science Web Development

Introduction to Computer Science Web Development Introduction to Computer Science Web Development Flavio Esposito http://cs.slu.edu/~esposito/teaching/1080/ Lecture 6 Review from last lecture A collection of CSS rules is called a Style Sheet Styles Sheet

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

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 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

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

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

<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

**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

Web Design and Implementation

Web Design and Implementation Study Guide 3 - HTML and CSS - Chap. 13-15 Name: Alexia Bernardo Due: Start of class - first day of week 5 Your HTML files must be zipped and handed in to the Study Guide 3 dropbox. Chapter 13 - Boxes

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

COMSC-031 Web Site Development- Part 2

COMSC-031 Web Site Development- Part 2 COMSC-031 Web Site Development- Part 2 Part-Time Instructor: Joenil Mistal December 5, 2013 Chapter 13 13 Designing a Web Site with CSS In addition to creating styles for text, you can use CSS to create

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

Parashar Technologies HTML Lecture Notes-4

Parashar Technologies HTML Lecture Notes-4 CSS Links Links can be styled in different ways. HTML Lecture Notes-4 Styling Links Links can be styled with any CSS property (e.g. color, font-family, background, etc.). a { color: #FF0000; In addition,

More information

COMM 2555: Interactive Digital Communication / Spring 2018 Lab 9: Basic layout techniques with CSS

COMM 2555: Interactive Digital Communication / Spring 2018 Lab 9: Basic layout techniques with CSS COMM 2555: Interactive Digital Communication / Spring 2018 Lab 9: Basic layout techniques with CSS Goals Practice working with the CSS box model, positioning and layout Step 1. Create your infrastructure

More information

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

Session 4. Style Sheets (CSS) Reading & References.   A reference containing tables of CSS properties Session 4 Style Sheets (CSS) 1 Reading Reading & References en.wikipedia.org/wiki/css Style Sheet Tutorials www.htmldog.com/guides/cssbeginner/ A reference containing tables of CSS properties web.simmons.edu/~grabiner/comm244/weekthree/css-basic-properties.html

More information

The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations).

The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations). WDI Fundamentals Unit 4 CSS Cheat Sheet Rule The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations). Declaration A declaration is made

More information

CSS Design and Layout Basic Exercise instructions. Today's exercises. Part 1: Arrange Page into Sections. Part 1, details (screenshot below)

CSS Design and Layout Basic Exercise instructions. Today's exercises. Part 1: Arrange Page into Sections. Part 1, details (screenshot below) CSS Design and Layout Basic Exercise instructions You may want to bring your textbook to Exercises to look up syntax and examples. Have a question? Ask for help, or look at the book or lecture slides.

More information

Web Recruitment Module Customisation

Web Recruitment Module Customisation Web Recruitment Module Customisation Introduction The People Inc. Web Recruitment add-on enables users to publish details of vacancies on their web site. This information is integrated seamlessly into

More information

CSS: formatting webpages

CSS: formatting webpages CSS: formatting webpages Why CSS? separate content from formatting (style) style can be changed easily without rewriting webpages keep formatting consistent across website allows more advanced formatting

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

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

<style type=text/css> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page*** Chapter 7 Using Advanced Cascading Style Sheets HTML is limited in its ability to define the appearance, or style, across one or mare Web pages. We use Cascading style sheets to accomplish this. Remember

More information

Web Authoring and Design. Benjamin Kenwright

Web Authoring and Design. Benjamin Kenwright CSS Div Layouts Web Authoring and Design Benjamin Kenwright Outline Review Why use Div Layout instead of Tables? How do we use the Div Tag? How to create layouts using the CSS Div Tag? Summary Review/Discussion

More information

TAG STYLE SELECTORS. div Think of this as a box that contains things, such as text or images. It can also just be a

TAG STYLE SELECTORS. div Think of this as a box that contains things, such as text or images. It can also just be a > > > > CSS Box Model Think of this as a box that contains things, such as text or images. It can also just be a box, that has a border or not. You don't have to use a, you can apply the box model to any

More information

What do we mean by layouts?

What do we mean by layouts? What do we mean by layouts? A layout is how you position the elements of your page You can have columns Move paragraphs and sections around And you can do this all without changing the content of your

More information

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web HTML & CSS SWE 432, Fall 2017 Design and Implementation of Software for the Web HTML: HyperText Markup Language LaToza Language for describing structure of a document Denotes hierarchy of elements What

More information

CSC 337. Cascading Style Sheets. Marty Stepp, Rick Mercer

CSC 337. Cascading Style Sheets. Marty Stepp, Rick Mercer CSC 337 Cascading Style Sheets Marty Stepp, Rick Mercer Preview of a style sheet /* The good way, with a preview of cascading style sheet (css) that has class mystyle */ body { background-color: grey;.mystyle

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

Taking Fireworks Template and Applying it to Dreamweaver

Taking Fireworks Template and Applying it to Dreamweaver Taking Fireworks Template and Applying it to Dreamweaver Part 1: Define a New Site in Dreamweaver The first step to creating a site in Dreamweaver CS4 is to Define a New Site. The object is to recreate

More information

Let s start with the document tree

Let s start with the document tree CSS INHERITANCE Let s start with the document tree Before we explore inheritance, we need to understand the document tree. All HTML documents are trees. Document trees are made from HTML elements. The

More information

CSS 1: Introduction. Chapter 3

CSS 1: Introduction. Chapter 3 CSS 1: Introduction Chapter 3 Textbook to be published by Pearson Ed 2015 in early Pearson 2014 Fundamentals of Web http://www.funwebdev.com Development What is CSS? You be styling soon CSS is a W3C standard

More information

UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013

UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013 UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013 SUBJECT CODE : SCSV1223 (Section 05) SUBJECT NAME : WEB PROGRAMMING YEAR/COURSE : 1SCSV TIME : 2.00 4.00 PM DATE : 18 APRIL 2013 VENUE : KPU 10

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

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

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

CSS for Page Layout Robert K. Moniot 1

CSS for Page Layout Robert K. Moniot 1 CSS for Page Layout 2015 Robert K. Moniot 1 OBJECTIVES In this unit, you will learn: How to use style sheets for layout Controlling text flow, margins, borders, and padding Controlling visibility of elements

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

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

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

JSN PageBuilder 3 Configuration Manual Introduction

JSN PageBuilder 3 Configuration Manual Introduction JSN PageBuilder 3 Configuration Manual Introduction About JSN PageBuilder 3 JSN PageBuilder 3 is the latest innovation of Joomla! PageBuilder with great improvements in the interface, features, and user

More information

Introduction to Computer Science Web Development

Introduction to Computer Science Web Development Introduction to Computer Science Web Development Flavio Esposito http://cs.slu.edu/~esposito/teaching/1080/ Lecture 8 Lecture Outline: Advanced CSS Pseudo-Classes CSS interacting with users CSS Cascading

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

By Ryan Stevenson. Guidebook #3 CSS

By Ryan Stevenson. Guidebook #3 CSS By Ryan Stevenson Guidebook #3 CSS Table of Contents 1. How to Use CSS 2. CSS Basics 3. Text Sizes Colors & Other Styling 4. Element Layout Positioning & Sizing 5. Backgrounds & Borders How to Use CSS

More information

The Importance of the CSS Box Model

The Importance of the CSS Box Model The Importance of the CSS Box Model Block Element, Border, Padding and Margin Margin is on the outside of block elements and padding is on the inside. Use margin to separate the block from things outside

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

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model Unit 20 - Client Side Customisation of Web Pages Week 2 Lesson 4 The Box Model So far Looked at what CSS is Looked at why we will use it Used CSS In-line Embedded (internal style-sheet) External

More information

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

CSS مفاهیم ساختار و اصول استفاده و به کارگیری CSS مفاهیم ساختار و اصول استفاده و به کارگیری Cascading Style Sheets A Cascading Style Sheet (CSS) describes the appearance of an HTML page in a separate document : مسایای استفاده از CSS It lets you separate

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

Before you begin, make sure you have the images for these exercises saved in the location where you intend to create the Nuklear Family Website.

Before you begin, make sure you have the images for these exercises saved in the location where you intend to create the Nuklear Family Website. 9 Now it s time to challenge the serious web developers among you. In this section we will create a website that will bring together skills learned in all of the previous exercises. In many sections, rather

More information

White Paper April Using Cascading Style Sheets (CSS) with AR System 6.x

White Paper April Using Cascading Style Sheets (CSS) with AR System 6.x April 2004 Using Cascading Style Sheets (CSS) with AR System 6.x Copyright 2004 BMC Software, Inc. All rights reserved. Remedy, the Remedy logo, all other Remedy product or service names, BMC Software,

More information

Positioning in CSS: There are 5 different ways we can set our position:

Positioning in CSS: There are 5 different ways we can set our position: Positioning in CSS: So you know now how to change the color and style of the elements on your webpage but how do we get them exactly where we want them to be placed? There are 5 different ways we can set

More information

Unveiling the Basics of CSS and how it relates to the DataFlex Web Framework

Unveiling the Basics of CSS and how it relates to the DataFlex Web Framework Unveiling the Basics of CSS and how it relates to the DataFlex Web Framework Presented by Roel Fermont 1 Today more than ever, Cascading Style Sheets (CSS) have a dominant place in online business. CSS

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

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model Unit 20 - Client Side Customisation of Web Pages Week 2 Lesson 4 The Box Model Last Time Looked at what CSS is Looked at why we will use it Used CSS In-line Embedded (internal style-sheet) External

More information

Getting Started with CSS Sculptor 3

Getting Started with CSS Sculptor 3 Getting Started with CSS Sculptor 3 With CSS Sculptor, you can quickly create a cross-browser compatible layout with custom widths, margins, padding, background images and more. Additionally, you can use

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