Layout using CSS. Using multiple classes In the head:.important{font-style:italic;}.title{color:red;} In the body: Here's a type of paragraph that is.

Slides:



Advertisements
Similar presentations
Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything Text Lists Other tables Pictures …
Advertisements

HTML and CSS. HTML Hyper Text Markup Language Tells browser how to display text and images.
Cascading Style Sheets
Cascading Style Sheets
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Today CSS HTML A project.
Presenter: James Huang Date: Sept. 26,  Introduction  Basics  Lists  Links  Forms  CSS 2.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 7 Page Layout Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Very quick intro HTML and CSS. Sample html A Web Title.
Part 5 Introduction to CSS. CSS Display - Block and Inline Elements A block element is an element that takes up the full width available, and has a line.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
Session 4: CSS Positioning Fall 2006 LIS Web Team.
INTRODUCTORY Tutorial 7 Creating Liquid Layouts. XP Objectives Discern the differences among various types of layouts Create a liquid layout Create a.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
With CSS, a color is most often specified by: a HEX value - like "#ff0000" an RGB value - like "rgb(255,0,0)" a color name - like "red“ Example h1.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Floating Elements CS380.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Class four: the box model and positioning. is an HTML tag which allows you to create an element out of inline text. It doesn’t mean anything! try it:
ADVANCED CSS William Neely CEO, Piecewise.com. CSS FONTS AND TEXT CSS ‣ Line-height allows to indicate the amount of space between lines; allows for equal.
Unit 20 - Client Side Customisation of Web Pages
CSS normally control the html elements. Three Ways to Insert CSS There are three ways of inserting a style sheet: External style sheet Internal style.
More CSS CS HTML id attribute 2 Coding Horror! Our mission is to combine programming and “human” factors with geekiness! output  A unique ID for.
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
Using CSS for Page Layout. Types of HTML Elements Block-Level Element –Creates blocks of content e.g. div, h1..h6, p, ul, ol, li, table, form –They start.
MORE Cascading Style Sheets (The Positioning Model)
4.01 Cascading Style Sheets
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
ITP 104.  While you can do things like this:  Better to use styles instead:
Learning HTML. HTML Attributes HTML elements can have attributes Attributes provide additional information about an element Class – specifies a class.
Copyright © Terry Felke-Morris CSS Flow & Positioning 1 Copyright © Terry Felke-Morris.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CSCE 102 – Chapter 6 (Web Design and Layout) CSCE General Applications Programming Benito Mendoza Benito Mendoza 1 By Benito Mendoza.
Lecture 2 - HTML and CSS Review SFDV3011 – Advanced Web Development 1.
Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything › Text › Lists › Other tables › Pictures › …
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
Today’s objectives  Announcements  Positioning  Measurement units.
Cascading Styles Sheets Positioning HTML elements.
INTRODUCTION ABOUT DIV Most websites have put their content in multiple columns. Multiple columns are created by using or elements. The div element is.
Creating Web Documents CSS examples (do more later) Lab/Homework: Read chapters 15 & 16. Work on Project 3, do postings.
WebD Introduction to CSS By Manik Rastogi.
Working with Cascading Style Sheets
( Cascading style sheet )
The Box Model in CSS Web Design – Sec 4-8
CSS Layouts: Grouping Elements
Webpage layout using CSS
CSS Rule Selector Declaration Block Value Attribute Name body {
Cascading Style Sheets (Layout)
Chapter 7 Page Layout Basics Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
Styles and the Box Model
MORE Cascading Style Sheets (The Positioning Model)
DynamicHTML Cascading Style Sheet Internet Technology.
Float Property Elements that seem to “float" on the right or left side of either the browser window or another element are often configured using.
Web Development & Design Foundations with H T M L 5
DynamicHTML Cascading Style Sheet Internet Technology.
More CSS Page layout Boriana Koleva Room: C54
How to use the CSS box model for spacing, borders, and backgrounds
Principles of Web Design 5th Edition
CSc 337 Lecture 5: Grid layout.
Presentation transcript:

Layout using CSS

Using multiple classes In the head:.important{font-style:italic;}.title{color:red;} In the body: Here's a type of paragraph that is intended to be displayed in italic.

The goal

Part 1: Layout

The concept Use tags to structure the blocks of the page. (content) Define a style for tags to achieve the desired output. (presentation)

1. Basic properties width (default is 100%) padding (ex: padding: 10px;) background (ex: background: #ffffff;) etc

2. Floating elements Enables blocks to be aligned Property: – float: left; – float: right; – float: none;

2. Floating elements, example Three divs in a page, with following style: div.title{ float:left; border:1px solid gray; padding:10px; } Output: layoutb.html

2. Floating elements, example Three divs in a page, with following style: div.title{ width:200px; float:left; border:1px solid gray; padding:10px; } Output: layoutc.html

3. Positioning Elements can be positioned at any coordinates in the page Property: – position: static; – position: relative; – position: absolute;

Positioning example Three divs in a page, with following style: div.title{ width:200px; position: absolute; top: [100,200,300]px; left: [100,200,300]px; border:1px solid gray; padding:10px; } Output: layoutd.html

1. no layout Page Title This is the first block. This is still the first block. This is the second block. layout1.html

Output

2. Three sections (1) Page Title...

2. Three sections (2)... This is the first block This is still the first block....

2. Three sections (3)... This is the second block.

Output

2. Three “ typed ” sections (1) Page Title...

2. Three sections (2)... This is the first block This is still the first block....

2. Three sections (3)... This is the second block.

Output

3. Writing a style (1) div.title{ border:1px solid gray; padding:10px; }...

3. Writing a style (2)... div.part1{ border:1px solid gray; padding:10px; }...

3. Writing a style (3)... div.part2{ border:1px solid gray; padding:10px; } layout2.html

Output

4. Two column layout v1 - right column has variable width

4. Two column layout v1

4. Two column layout v1 (1) div.title{ border:1px solid gray; padding:10px; }...

4. Two column layout v1 (2)... div.part1{ float: left; width:200px; border:1px solid gray; padding:10px; }...

4. Two column layout v1 (3)... div.part2{ margin-left:222px; border:1px solid gray; padding:10px; }

Output As required Right column has variable width layout2col1.html

5. Two column layout v2 – left column has variable size

5. Two column layout v2

5. Two column layout v2 (1) div.title{ border:1px solid gray; padding:10px; }...

5. Two column layout v2 (2)... div.part1{ margin-right:222px; border:1px solid gray; padding:10px; }...

5. Two column layout v2 (3)... div.part2{ float:right; width:200px; border:1px solid gray; padding:10px; }

Output As required Left column has variable width In Body of document, part1 and part2 have been swapped, otherwise doesn't work At home, try to swap them back and see what happens... There's a way to make the layout work without swapping. See three column example further on... layout2col2.html

6. Three column layout v1 – Right column has variable width

6. Three column layout v1

6. Change in the document body... layout3col1.html

6. Three column layout v1 (1)... div.part1{ float: left; width:200px; border:1px solid gray; padding:10px; }...

6. Three column layout v1 (2)... div.part3{ float: left; width:200px; border:1px solid gray; padding:10px; }...

6. Two column layout v1 (3)... div.part2{ margin-left:444px; border:1px solid gray; padding:10px; }

8. Three column layout v3 – All three columns have variable widths

8. Three column layout v3

8. Three column layout v3 (1)... div.part1 { float: left; width:20%; border:1px solid gray; }... layout3col3.html

8. Three column layout v3 (2)... div.part3 { float:left; width:58%; border:1px solid gray; }...

8. Three column layout v3 (3)... div.part2 { float:left; width:20%; background:#ffffff; border:1px solid gray; }