Cascading Style Sheets (Part II)

Size: px
Start display at page:

Download "Cascading Style Sheets (Part II)"

Transcription

1 Cascading Style Sheets (CSSs) (Part II) Page Layout with Styles...1 Offsetting Elements...1 Positioning Elements Absolutely...3 Positioning Elements in 3D...4 Displaying and Hiding Elements...5 Setting an Element s Height and Width...6 Setting an Element s Border...7 Adding Padding around an Element...8 Setting the Margins around an Element...10 Aligning Elements Vertically...12 Wrapping Text around Elements...13 Stopping Text Wrapping...15 Changing the Foreground Colour...16 Changing the Background...17 Determining where Overflow Should Go...19 Clipping an Element...20 Setting List Properties...21 Specifying Page Breaks...23

2 Cascading Style Sheets (CSSs) (Part II) Page Layout with Styles Every item that is created using CSSs is enclosed in an invisible box - the size, colour, spacing and the way it flows can be controlled with respect to other objects on the page. An element s box may be block-level or inline; whilst the first generates a new paragraph, the second does not. There are three special areas of the box, which can be controlled the padding, border and margin. Surrounding the contents of the box is the padding; around the padding is the border, and around the border is the margin (a transparent space). The margin s width and height can be changed in order to control the position of the elements on your page. Some elements may contain other elements on the page; they are referred to as parents. Offsetting Elements Each of the elements on a page has a natural location in the flow of the page. Relative positioning refers to the movement of an element with respect to its original location. Relative positioning does not affect the positioning of any surrounding elements at all. In order to offset an element within the natural flow: 1. Type position: relative; in the element s definition in the <style> section of the HTML document (or in the relevant section of the external.css file). 2. Type top, right, bottom or left 3. Type : d; where d is the desired distance that you want to offset the element from its natural location; either as an absolute or relative value. 1

3 Example <title>offsetting Elements within the Natural Flow</title> img {position:relative; top: 0px; left:0px;} img.test {position:relative; top:-20px; left:25px;} <br /> <img src="logo.gif" alt="html4.co.uk s logo" /> <img src="logo.gif" alt="html4.co.uk s logo" class="test" /> The relative positioning refers to the element s original position, not the surrounding elements. You cannot move elements with respect to other elements, just with respect to where they used to be. The other elements are not affected by the offsets they flow with the original containing box of the element. 2

4 Positioning Elements Absolutely The elements in your web page would flow in the order in which they appear. If the <ol> tag for example appears before the <table> tag, then the ordered list would appear before the table. This is known as the normal flow. In addition to being able to offset individual elements, styles also allow you to take elements out of the normal flow, and position them absolutely by specifying their precise position with respect to their parent element. In order to absolutely position elements: 1. Type position: absolute; in the element s definition in the <style> section of the HTML document (or in the relevant section of the external.css file). 2. Type top, right, bottom or left 3. Type : d; where d is the desired distance that you want to offset the element from its natural location; either as an absolute or relative value. Example <title>positioning Elements Absolutely</title> img {position:absolute; top:10px; left:10px;} <br /> <img src = "logo.gif" alt="html4.co.uk s logo" /> <img src = "minilogo.gif" alt="html4.co.uk s mini logo" /> 3

5 Because absolutely positioned elements are taken out of the natural flow, they can overlap each other. Positioning Elements in 3D Having tried out both relative and absolute positioning, you may want to choose, which element should be on top. In order to position elements in 3D: Type z-index: n in the element s definition in the <style> section of the HTML document (or in the relevant section of the external.css file), where n is a number, which indicates the position of the element in the stack of objects. Example <title>positioning Elements in 3D</title> img {position:absolute; top:10px; left:10px} img.test {position:absolute; top:10px; left:10px; z-index:-1} <img src = "logo.gif" alt="html4.co.uk s logo" /> <img src = "minilogo.gif" alt="html4.co.uk s mini logo" class="test" /> 4

6 Displaying and Hiding Elements The display property is useful for hiding or revealing particular elements on your web page depending on the visitor s browser, language preference, or other criteria. You can also choose, whether you want to display an element as block-level or inline. In order to specify how your page s elements should be displayed: 1. Type display: 2. Type none in order to hide elements block in order to display the element as a block-level (which would start a new paragraph) inline in order to display the element as inline (which would not start a new paragraph) list-item in order to display the element as if though it was a list element. Example <title>displaying and Hiding Elements with Styles</title> img {position:absolute; top:10px; left:10px;} img.test {display:none} 5

7 <img src= "logo.gif" alt="html4.co.uk s logo" /> <img src= "minilogo.gif" alt="html4.co.uk s mini logo" class="test" /> In contrast to the previous example, the image, which was positioned behind the logo above, has not appeared, as the display: none property was used in the style s definition. Setting an Element s Height and Width Styles are also used to set the height and width for most elements on your page, including images, form elements and even blocks of text. In order to set the height and width for an element: 1. Type width: w where w is the width of the element, and can be expressed either as an absolute value or as a percentage of the window width. 2. Type height: h where h is the height of the element, and can be expressed only as an absolute value. You cannot set the width property for most text tags (such as P and H1). 6

8 Example <title>setting an Element s Height and Width</title> img {position:absolute; top:10px; left:10px; width: 30%; height: 200px} <img src="logo.gif" alt="html4.co.uk s logo" /> Setting an Element s Border Styles allow you to create a border around an element and then set its thickness, style and colour. In order to set the border: 1. Type border 2. If wanted, type top, -bottom, -left or right with no space after border in order to limit where the border should go. 3. If wanted, type :thin, medium, thick or an absolute value to specify the thickness of the border. 7

9 4. If wanted, type none, dotted, dashed, solid, double, groove, ridge, inset or outset to specify the border style. 5. If desired, type color where color can be either one of the sixteen pre-defined colours or a hexidecimal colour code. Example <title> Setting an element s border</title> img {position:absolute; top: 10px; left: 10px; border-left: thick double #ff00ff;} <img src="logo.gif" alt="html4.co.uk s logo" /> Adding Padding around an Element Styles allow you to add padding (extra space) around the contents of an element but inside the border. You can change the padding s thickness, but not its colour or texture. 8

10 In order to add padding around an element: 1. Type padding 2. If wanted, type top, -bottom, -left or right with no space after padding in order to limit the padding only around one side of the object. 3. Type : x where x is the amount of desired space to be added, expressed in units or as a percentage of the parent element. When adding padding with styles, several shortcuts are available to allow us to set the padding values. Here are some of them: In order to set the top, right, bottom and left values in that order at once, type padding: t r b l In order to set the top and bottom values equally and the left and right values equally, type padding: v h In order to set the value for all sides, type padding: a Example <title>adding Padding around an Element</title> h1{padding:50px; border: thick double black;} <h1>welcome to my web-site</h1> <img src="logo.gif" alt="html4.co.uk s logo" /> 9

11 Setting the Margins around an Element The margin is the amount of transparent space between one element and the next, in addition to and outside of any padding or border around the element. In order to set an element s margin: 1. Type margin 2. If wanted, type top, -bottom, -left or right with no space after margin in order to limit where space should be added. 3. Type : x where x is the amount of desired space to be added, expressed in units or as a percentage of the width parent element. When setting the margins with styles, several shortcuts are available to allow us to set the margin values. Here are some of them: In order to set the top, right, bottom and left values in that order at once, type margin: t r b l In order to set the top and bottom values equally and the left and right values equally, type margin: v h In order to set the value for all sides, type margin: a 10

12 Example <title>setting the Margins around an Element</title> h1{padding:50px; margin-bottom: 50px; border: thick double black;} <h1>welcome to my web-site</h1> <img src="logo.gif" alt="html4.co.uk s logo" /> In contrast with the previous example there is an additional margin of 50 units added after the Welcome to my web-site element of the above web page. 11

13 Aligning Elements Vertically The elements of a Web page can be aligned vertically in the same way, like for example images on a web page. In order to align elements vertically: 1. Type vertical-align: 2. Type baseline to align the element s baseline with the parent s baseline middle to align the middle of the element with the middle of the parent sub to position the element as a subscript of the parent super to position the element as a superscript of the parent text-top to align the top of the element with the top of the parent text-bottom to align the bottom of the element with the bottom of the parent top to align the top of the element with the top of the tallest element on the line bottom to align the bottom of the element with the bottom of the tallest element on the line percentage of the line height of the element (positive or negative) Example <title>aligning elements vertically</title> img {vertical-align:top} 12

14 <br /> <img src="logo.gif" alt="html4.co.uk s logo" /> <img src="minilogo.gif" alt="html4.co.uk s mini logo" /> Wrapping Text around Elements Styles can be used to wrap text around elements. In order to wrap text around elements: 1. Type float: 2. Type left if you want the text to flow to the right of the element. or right if you want the text to flow to the left of the element. 13

15 Example <title>wrapping text around elements using styles</title> img.left {float:left} img.right{float:right} ol{text-indent:2em} <br /> <img src = "logo.gif" alt="html4.co.uk s logo" class="left" /> Welcome to html4.co.uk! <p>the topics covered on the course are as follows:</p> <ol> <li>html Basics</li> <li>text Formatting</li> <li>..</li> </ol> <p>today's teaching session is aimed to show you how to construct a web page using HTML.</p> <p>before we start constructing HTML pages however, I would like to introduce you briefly to the HTML language and some basic HTML concepts.</p> <p> <img src="logo.gif" alt="html4.co.uk s logo" class="right" /></p> <p>html stands for Hyper Text Markup Language and was developed in Switzerland by the programmers at the CERN research laboratory.</p> <p>the father of HTML is considered to be Tim Berners Lee, who was the driving force behind the development of the World Wide Web. </p> 14

16 Stopping Text Wrapping In addition to allowing you to wrap text around elements, styles also allow you to stop the text from wrapping around an element. In order to do that: 1. Type clear: 2. Type left to stop the flow until the left side is clear of all elements right to stop the flow until the right side is clear of all elements both to stop the flow until both sides are clear of all elements none to continue the flow 15

17 Changing the Foreground Colour Styles allow you to change the colour of any element, including horizontal lines, form elements, and tables. In order to change the foreground colour: 1. Type color: 2. Type colorname where colorname is either one of the 16 predefined colours, a colour s hexidecimal value (#rrggbb), or is denoted by specifying the amount of red, green and blue (either using integers from rgb (r,g,b) or percentages rgb (r%, g%, b%) Example <title>changing the foreground using styles</title> img.left {float:left} ol{text-indent:2em} hr {color:blue; height:20px;) <br /> <img src="logo.gif" alt="html4.co.uk s logo" class="left" /> Welcome to html4.co.uk! <hr></hr> <p>the topics covered on the course are as follows:</p> <ol> <li>html Basics</li> <li>text Formatting</li> <li>..</li> </ol> 16

18 Changing the Background The background in this context refers not to the background of the entire page, but to the background of a particular tag. In order to change the background of a tag: 1. Type background: 2. Type transparent or colorname where colorname is either one of the 16 pre-defined colours or the colour s hexidecimal value (#rrggbb). 3. If wanted, type url(image.gif), to use an image for the background; if wanted, you can also type: repeat repeat-x repeat-y fixed or scrolled or type x y to tile the image both horizontally and vertically to tile the image only horizontally to tile the image only vertically to specify whether the background should scroll with the canvas where x and y can be expressed as a percentage or as an absolute distance, or can be the values of top, center and bottom for x and left, right and center for y. 17

19 Example <title>changing the background using styles</title> img.left {float:left} ol{text-indent:2em} body{background: url(minilogo.gif)} p.intro {background: white; padding:5px) <br /> <img src = "logo.gif" alt="html4.co.uk s logo" class="left" /> Welcome to html4.co.uk! <p>the topics covered on the course are as follows:</p> <ol> <li>html Basics</li> <li>text Formatting</li> <li>..</li> </ol> <p class="intro">today's teaching session is aimed to show you how to construct a web page using HTML. Before we start constructing HTML pages however, I would like to introduce you briefly to the HTML language and some basic HTML concepts.</p> 18

20 Determining where Overflow Should Go As explained at the beginning of this handout, every element is enclosed in a box (container) on the web page. If the element s box height and weight are changed in such a way that the contents of the element are in excess of the box s dimensions then an overflow occurs. In order to deal with this overflow, you should follow these instructions: 1. Type overflow: 2. Type visible to expand the element s box so that its contents can fit in it. Example or type hidden to hide any contents that don t fit the element s box or type scroll to add scroll bars allowing the visitor to access the overflow, which has occurred. <title>dealing with Overflow using styles</title> body{background: url(minilogo.gif)} p.intro {background: white; padding:5px;} <div style="position:relative; width:100px; height:100px; overflow:scroll"> <p class="intro">today's teaching session is aimed to show you how to construct a web page using HTML. Before we start constructing HTML pages however, I would like to introduce you briefly to the HTML language and some basic HTML concepts.</p> </div> 19

21 Clipping an Element Styles allow you to reveal only a particular section of an element by clipping the element. In order to clip an element: 1. Type clip:rect ( 2. Type t r b l where t r b l is top is right is bottom is left coordinates of the rectangular portion of the element that you want to display. 3. Type the final ) With the current style sheets specification, an element has to be positioned absolutely before it can be clipped. <title>clipping an Element using styles</title> body{background: url(minilogo.gif)} p.intro {background: white; padding:5px;} 20

22 <div style="position:relative; width:100px; height:100px; overflow:scroll"> <p class="intro">today's teaching session is aimed to show you how to construct a web page using HTML. Before we start constructing HTML pages however, I would like to introduce you briefly to the HTML language and some basic HTML concepts.</p> </div> <img src="logo.gif" style="position:absolute;top:150px; clip:rect( )" alt="logo"/> Setting List Properties Styles allow you to set up list properties. In order to set the properties of a list: 1. Type list-style: 2. Choose one of the following: disc to set the list item marker to a solid, round circle circle to set the list item marker to an empty round circle square to set the list item marker to a solid square decimal to set the list item marker to use arabic numerals lower-alpha to set the list item marker to use lowercase letters upper-alpha to set the list item marker to use uppercase letters 21

23 lower-roman to set the list item marker to use lower-case Roman numerals upper-roman to set the list item marker to use upper-case Roman numerals url(image) where image is the URL of the image you want to use as a list marker 3. If wanted, type outside to hang the marker to the left of the list items or inside to align the marker flush left together with the list items. Example <title>setting List Properties using styles</title> body{background:white} li{list-style:url(minilogo.gif) inside} <ol> <li>today's teaching session is aimed to show you how to construct a web page using HTML.</li> <li>before we start constructing HTML pages however, I would like to introduce you briefly to the HTML language and some basic HTML concepts.</li> </ol> 22

24 Specifying Page Breaks If your visitors want to print out your Web page, the browsers would automatically adjust the contents on the page in order to best fit the paper size the visitor has chosen in the Page Setup dialog window. Cascading Style Sheets (version 2) allows you to specify where you want the page to break when your visitor prints out the web page. In order to specify a page break after a tag just type: page-break-after:always In order to specify a page break before a tag just type: page-break-before:always In order to remove page breaks just type: page-break-before:auto or page-break-after:auto Example <title>specifying page breaks using styles</title> body{background:white} p.first,p.second{page-break-before:always} <p class="first" style="page-break-before:auto"> Today's teaching session is aimed to show you how to construct a web page using HTML. </p> <p class="second">before we start constructing HTML pages however, I would like to introduce you briefly to the HTML language and some basic HTML concepts. </p> 23

25 24

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

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

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

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

12/9/2012. CSS Layout

12/9/2012. CSS Layout Dynamic HTML CSS Layout CSS Layout This lecture aims to teach you the following subjects: CSS Grouping and nesting Selectors. CSS Dimension. CSS Display.. CSS Floating. CSS Align. 1 CSS Grouping and nesting

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

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

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

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

Cascading Style Sheets CSCI 311

Cascading Style Sheets CSCI 311 Cascading Style Sheets CSCI 311 Learning Objectives Learn how to use CSS to style the page Learn to separate style from structure Styling with CSS Structure is separated from style in HTML5 CSS (Cascading

More information

Client-Side Web Technologies. CSS Part II

Client-Side Web Technologies. CSS Part II Client-Side Web Technologies CSS Part II Topics Box model and related properties Visual formatting model and related properties The CSS Box Model Describes the rectangular boxes generated for elements

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

GoSquared Equally Rounded Corners Equally Rounded Corners -webkit-border-radius -moz-border-radius border-radius Box Shadow Box Shadow -webkit-box-shadow x-offset, y-offset, blur, color Webkit Firefox

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

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

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

CASCADING STYLESHEETS

CASCADING STYLESHEETS CASCADING STYLESHEETS Cascading StyleSheets (CSS) has been mainly created because HTML is just not the right tool for precision and flexibility. HTML is not a very effective for designing web pages. Most

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

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

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

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

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

IMY 110 Theme 6 Cascading Style Sheets

IMY 110 Theme 6 Cascading Style Sheets IMY 110 Theme 6 Cascading Style Sheets 1. Cascading Style Sheets 1.1. Cascading Style Sheets Up to now we have done styling by using the style attribute. e.g. paragraph What

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

Creating Layouts Using CSS. Lesson 9

Creating Layouts Using CSS. Lesson 9 Creating Layouts Using CSS Lesson 9 CSS Page Layout Advantages Greater typography control Style is separate from structure Potentially smaller documents Easier site maintenance Increased page layout control

More information

Web Design and Development Tutorial 03

Web Design and Development Tutorial 03 Table of Contents Web Design & Development - Tutorial 03... 2 Using and Applying CSS to XHTML... 2 Conventions... 2 What you need for this tutorial... 2 Common Terminology... 3 Parent / Child Elements...

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

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

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

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

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

CSS: Lists, Tables and the Box Model

CSS: Lists, Tables and the Box Model CSS: Lists, Tables and the Box Model CISC 282 September 20, 2017 Basics of CSS Style Name classes semantically What the style is intended for not what it does Define and apply styles efficiently Choose

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

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

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

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

FLOATING AND POSITIONING

FLOATING AND POSITIONING 15 FLOATING AND POSITIONING OVERVIEW Understanding normal flow Floating elements to the left and right Clearing and containing floated elements Text wrap shapes Positioning: Absolute, relative, fixed Normal

More information

ITNP43: HTML Lecture 5

ITNP43: HTML Lecture 5 ITNP43: HTML Lecture 5 1 The Box Model Every HTML element (e.g. h2, p etc) lies within a virtual box: Margin area LEFT TOP This is just some text that flows onto two lines. Border RIGHT Padding area BOTTOM

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 (2/2/2018) Layout & Position: 1 INTERNATIONAL UNIVERSITY OF JAPAN Public Management and Policy Analysis Program Graduate School of International Relations DCC5382 (2 Credits) Introduction

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

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

Page Layout Using Tables

Page Layout Using Tables This section describes various options for page layout using tables. Page Layout Using Tables Introduction HTML was originally designed to layout basic office documents such as memos and business reports,

More information

1 of 7 11/12/2009 9:29 AM

1 of 7 11/12/2009 9:29 AM 1 of 7 11/12/2009 9:29 AM Home Beginner Tutorials First Website Guide HTML Tutorial CSS Tutorial XML Tutorial Web Host Guide SQL Tutorial Advanced Tutorials Javascript Tutorial PHP Tutorial MySQL Tutorial

More information

escuela técnica superior de ingeniería informática

escuela técnica superior de ingeniería informática Tiempo: 2h escuela técnica superior de ingeniería informática Previous versions: David Benavides and Amador Durán Toro (noviembre 2006) Manuel Resinas (october 2007) Last revision:pablo Fernandez, Cambios

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

Web Site Design and Development Lecture 7. CS 0134 Fall 2018 Tues and Thurs 1:00 2:15PM

Web Site Design and Development Lecture 7. CS 0134 Fall 2018 Tues and Thurs 1:00 2:15PM Web Site Design and Development Lecture 7 CS 0134 Fall 2018 Tues and Thurs 1:00 2:15PM Box Model All block elements and some inline elements, like img, are placed inside a box This lets you set the height

More information

Learning Objectives. Review html Learn to write a basic webpage in html Understand what the basic building blocks of html are

Learning Objectives. Review html Learn to write a basic webpage in html Understand what the basic building blocks of html are HTML CSCI311 Learning Objectives Review html Learn to write a basic webpage in html Understand what the basic building blocks of html are HTML: Hypertext Markup Language HTML5 is new standard that replaces

More information

Table Basics. The structure of an table

Table Basics. The structure of an table TABLE -FRAMESET Table Basics A table is a grid of rows and columns that intersect to form cells. Two different types of cells exist: Table cell that contains data, is created with the A cell that

More information

CSS stands for Cascading Style Sheets Styles define how to display HTML elements

CSS stands for Cascading Style Sheets Styles define how to display HTML elements CSS stands for Cascading Style Sheets Styles define how to display HTML elements CSS has various levels and profiles. Each level of CSS builds upon the last, typically adding new features and typically

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

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

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension HTML Website is a collection of web pages on a particular topic, or of a organization, individual, etc. It is stored on a computer on Internet called Web Server, WWW stands for World Wide Web, also called

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. M hiwa ahamad aziz Raparin univercity. 1 Web Design: Lecturer ( m hiwa ahmad aziz)

CSS. M hiwa ahamad aziz  Raparin univercity. 1 Web Design: Lecturer ( m hiwa ahmad aziz) CSS M hiwa ahamad aziz www.raparinweb.fulba.com Raparin univercity 1 What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve

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

Chapter 3 CSS for Layout

Chapter 3 CSS for Layout Chapter 3 CSS for Layout Chapter two introduced how CSS is used to manage the style of a webpage, this chapter explores how CSS manages the layout of a webpage. Generally a webpage will consist of many

More information

First Diploma Unit 10 Client Side Web. Week 4 -The CSS Box model

First Diploma Unit 10 Client Side Web. Week 4 -The CSS Box model First Diploma Unit 10 Client Side Web Week 4 -The CSS Box model Last Session CSS Basics Fonts Real world site This Session CSS box model Concept of identity -id The CSS box model represents every element

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

Hyper Text Markup Language HTML: A Tutorial

Hyper Text Markup Language HTML: A Tutorial Hyper Text Markup Language HTML: A Tutorial Ahmed Othman Eltahawey December 21, 2016 The World Wide Web (WWW) is an information space where documents and other web resources are located. Web is identified

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

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

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

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21 Table of Contents Chapter 1 Getting Started with HTML 5 1 Introduction to HTML 5... 2 New API... 2 New Structure... 3 New Markup Elements and Attributes... 3 New Form Elements and Attributes... 4 Geolocation...

More information

HTML and CSS COURSE SYLLABUS

HTML and CSS COURSE SYLLABUS HTML and CSS COURSE SYLLABUS Overview: HTML and CSS go hand in hand for developing flexible, attractively and user friendly websites. HTML (Hyper Text Markup Language) is used to show content on the page

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

B3: A first introduction to CSS 17/02/2006

B3: A first introduction to CSS 17/02/2006 ! " % % 1 & & ' ( 6 +,-.!! %! 5 7 % ) * +,-. /! ) (& & (& &! ' % 1 '!%!3! 4! % & (& & % % 55 %! " & Font Text Lists Color Background Border & Margin Positioning Visability Letter form, size, boldface,

More information

Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS. 8 Oct 2015

Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS. 8 Oct 2015 Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS 8 Oct 2015 What is CSS? o CSS (Style Sheet) defines how HTML elements are formatted and displayed. o It helps you easily change an HTML

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

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

HTML and CSS: An Introduction

HTML and CSS: An Introduction JMC 305 Roschke spring14 1. 2. 3. 4. 5. The Walter Cronkite School... HTML and CSS: An Introduction

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

Module 2 (VI): CSS [Part 3]

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

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

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

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

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

CSC309 Programming on the Web week 3: css, rwd

CSC309 Programming on the Web week 3: css, rwd CSC309 Programming on the Web week 3: css, rwd Amir H. Chinaei, Spring 2017 Office Hours: M 3:45-5:45 BA4222 ahchinaei@cs.toronto.edu http://www.cs.toronto.edu/~ahchinaei/ survey 1 in survey 1, you provide

More information

Produced by. Web Development. Eamonn de Leastar Department of Computing, Maths & Physics Waterford Institute of Technology

Produced by. Web Development. Eamonn de Leastar Department of Computing, Maths & Physics Waterford Institute of Technology Web Development Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie CSS: Box Model Worked

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

Using CSS for page layout

Using CSS for page layout Using CSS for page layout Advantages: Greater typographic control Style is separate from structure Potentially smaller documents Easier site maintenance Increased page layout control Increased accessibility

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

- 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

CSCB20 Week 7. Introduction to Database and Web Application Programming. Anna Bretscher Winter 2017

CSCB20 Week 7. Introduction to Database and Web Application Programming. Anna Bretscher Winter 2017 CSCB20 Week 7 Introduction to Database and Web Application Programming Anna Bretscher Winter 2017 Cascading Style Sheets (CSS) Examples of CSS CSS provides a powerful and stillevolving toolkit of style

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

Using Microsoft Word. Working With Objects

Using Microsoft Word. Working With Objects Using Microsoft Word Many Word documents will require elements that were created in programs other than Word, such as the picture to the right. Nontext elements in a document are referred to as Objects

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

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

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST GIMP WEB 2.0 MENUS Web 2.0 Menus: Horizontal Navigation Bar WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR Hover effect: CREATING AN HTML LIST Most horizontal or vertical navigation bars begin with a simple

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

CSS means Cascading Style Sheets. It is used to style HTML documents.

CSS means Cascading Style Sheets. It is used to style HTML documents. CSS CSS means Cascading Style Sheets. It is used to style HTML documents. Like we mentioned in the HTML tutorial, CSS can be embedded in the HTML document but it's better, easier and neater if you style

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

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

LBS Polytechnic. Hey! Make With The Style Sheet Already, Bub!

LBS Polytechnic. Hey! Make With The Style Sheet Already, Bub! When you're all done, the format will look like this: Hey! Make With The Style Sheet Already, Bub! This

More information

Cascading Style Sheets

Cascading Style Sheets 4 TVEZEWXYHMNR LSTVSKVEQY-RJSVQEXMOENITSHTSVSZ RETVSNIOXIQ RERGSZER Q^)ZVSTWO LSWSGM PR LSJSRHYEVS^TS XYLPEZR LSQ WXE4VEL] 4VELE)9-RZIWXYNIQIHSZE% FYHSYGRSWXM CSS Cascading Style Sheets Lukáš Bařinka barinkl@fel.cvut.cz

More information

EECS1012. Net-centric Introduction to Computing. Lecture 5: Yet more CSS (Float and Positioning)

EECS1012. Net-centric Introduction to Computing. Lecture 5: Yet more CSS (Float and Positioning) EECS 1012 EECS1012 Net-centric Introduction to Computing Lecture 5: Yet more CSS (Float and Positioning) Acknowledgements Contents are adapted from web lectures for Web Programming Step by Step, by M.

More information

Web Design and Development ACS Chapter 12. Using Tables 11/23/2017 1

Web Design and Development ACS Chapter 12. Using Tables 11/23/2017 1 Web Design and Development ACS-1809 Chapter 12 Using Tables 11/23/2017 1 Using Tables Understand the concept and uses of tables in web pages Create a basic table structure Format tables within web pages

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

SEEM4570 System Design and Implementation. Lecture 1 Cordova + HTML + CSS

SEEM4570 System Design and Implementation. Lecture 1 Cordova + HTML + CSS SEEM4570 System Design and Implementation Lecture 1 Cordova + HTML + CSS Apache Cordova Apache Cordova, or simply Cordova, is a platform for building native mobile apps using HTML, CSS and JavaScript E.g.

More information