What do we mean by layouts?

Similar documents
Styles, Style Sheets, the Box Model and Liquid Layout

Creating Layouts Using CSS. Lesson 9

HTML and CSS a further introduction

CSS worksheet. JMC 105 Drake University

The default style for an unordered (bulleted) list is the bullet, or dot. You can change the style to either a square or a circle as follows:

Web Design and Implementation

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

Internet Programming 1 ITG 212 / A

What is the Box Model?

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

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

COMSC-031 Web Site Development- Part 2

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

Adding CSS to your HTML

SASS Variables and Mixins Written by Margaret Rodgers. Variables. Contents. From Web Team. 1 Variables

Assignments (4) Assessment as per Schedule (2)

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

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

ORB Education Quality Teaching Resources

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

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

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

CSS Box Model. Cascading Style Sheets

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

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

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

FLOATING AND POSITIONING

Dreamweaver CS5 Lab 4: Sprys

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

ITNP43: HTML Lecture 5

Layout with Layers and CSS

Designing the Home Page and Creating Additional Pages

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

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

Chapter 16: PAGE LAYOUT WITH CSS

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

Using CSS for page layout

Module 2 (VII): CSS [Part 4]

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

Cascading Style Sheets CSCI 311

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.

The Importance of the CSS Box Model

Guidelines for doing the short exercises

Getting Started with Eric Meyer's CSS Sculptor 1.0

Cascading Style Sheets for layout II CS7026

Introduction to Cascading Style Sheet (CSS)

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

Introduction to Web Design CSS Reference

Using Dreamweaver CS6

Introduction to Web Design CSS Reference

epromo Guidelines DUE DATES NOT ALLOWED PLAIN TEXT VERSION

4/17/2013. Outline. List Styles. List Styles INTRODUCTION TO WEB DEVELOPMENT AND HTML

Microsoft Expression Web Quickstart Guide

CSCU9B2: Web Tech Lecture 3

Creating Page Layouts 25 min

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

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

Taking Fireworks Template and Applying it to Dreamweaver

ICT IGCSE Practical Revision Presentation Web Authoring

CSS Exercises. Create a basic CSS layout Use BlueFish to open layout.html Create a layout using <div> tags Use a browser (Firefox) to view your page

HIERARCHICAL ORGANIZATION

How to lay out a web page with CSS

c122sep2214.notebook September 22, 2014

Using Dreamweaver CS6

5. When the Plugin Installed Successfully message appears, click Activate Plugin. You re all set, so let s get started with your first recipe post.

Block & Inline Elements

COMS 359: Interactive Media

Create a three column layout using CSS, divs and floating

Creating a Job Aid using HTML and CSS

Web Engineering CSS. By Assistant Prof Malik M Ali

When you complete this chapter, you will be able to:

Magazine-style websites often have lots of small items on a page. First you re going to create a heading and background for your magazine.

Building Page Layouts

Exploring Computer Science Web Final - Website

Web Design and Development Tutorial 03

Lesson 1 using Dreamweaver CS3. To get started on your web page select the link below and copy (Save Picture As) the images to your image folder.

HTMLnotesS15.notebook. January 25, 2015

CSS: Layout Part 2. clear. CSS for layout and formatting: clear

AGENDA :: MULTIMEDIA TOOLS :: (1382) :: CLASS NOTES

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

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

ICT IGCSE Practical Revision Presentation Web Authoring

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

Web Authoring and Design. Benjamin Kenwright

CS Multimedia and Communications. Lab 06: Webpage Tables and Image Links (Website Design part 3 of 3)

Chapter 3 CSS for Layout

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

CS7026 CSS3. CSS3 Graphics Effects

Interactive Tourist Map

Table Basics. The structure of an table

Getting Started with CSS Sculptor 3

Reading 2.2 Cascading Style Sheets

HTML & CSS for Library Professionals

Introduction to Computer Science Web Development

Introduction to WEB PROGRAMMING

Client-Side Web Technologies. CSS Part II

CSS: formatting webpages

Cascading Style Sheets Level 2

Page Layout Using Tables

Transcription:

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 html! Lets see a few examples

Banner on top Links menu on the left Main content under header Artemis: 2 column layout

Livejournal: 2 column layout Header Main content under header Menu on the right

Shopping cart, search bar, and links on top Navigation menu on the left Featured items on the right Etsy: 2 column layout

What We re Going To Do Since 2 column layouts are so popular, that s exactly what we re going to learn 2 column layouts allow you to put a menu in one small column and content in the larger column There are many other ways to do layouts

Box Model To understand layouts you need to know about the box model All elements in CSS are boxes They consist of Content Padding Borders Margin

Box Model: Content The area called content contains the actual content of the element Text in a paragraph Picture in an image A list in a list element The content goes right up to the very edge of the content box

Box Model: Padding Padding is the space that goes between the contents and any border that you might put on the block #example { padding: 30px; } Define the padding size in pixels Other properties: padding top, padding right, padding bottom, padding left

Box Model: Borders Borders go around padding and content #example { border: solid; } Options are width, style, and color Style values: dotted, dashed, solid, double, groove, etc. Separate with a space border: 2px double #000000; Other properties: border top, border right, borderbottom, border left

Box Model: Margin Margin is the space between your border and the rest of the elements on the page #example { margin: 50px; } Define margin size in pixels Other properties: margintop, margin right, marginbottom, margin left

Practice 1 Go back to the CATS! website and change it so that it has a padding, border, and margin around the printer cat section and tech kitty section Since we want to change those whole sections we can use the div blocks we made last time So here are the changes we re going to make to those sections margin should be 30px padding should be 10px border width should be thick border style should be double border color should be the same as the font colors for each section

Practice 1 Answer.printerCat { } color:purple; background-color:#dbcff6; margin:30px; padding:10px; border:thick double purple;.techkitty { color:green; background-color:#9f9; margin:30px; padding:10px; border:thick double green; } There s more than one way to do this!

Floating There are quite a few ways to set up layouts in CSS. Two of the most common ways are Floating Absolute Positioning Floating takes care of the details for you, so that s what we ll be working with

The Float Property The CSS looks like this #sidebar { width: 150px; float: left; } It looks like this The links are floating to the left of the main content!

How float works with the flow The Flow A page is laid out in order of elements. The top of the html file goes first and it follows the order down to the bottom. This is called the flow. When you float something, you take it out of the flow and move it to the left or right. All the other elements then flow around it.

How to Use Float Put a div around the section that you want to move to another column Position it in the right part of your html file Give it a width using CSS For example, width: 150px; Then tell it to float either left or right float: left; or float: right;

Positioning the Floating Section So how do you know where the correct section to put your html is? The browser puts everything down on the page in the order they appear in the html file Your float will move to left or right after everything before it This means the float will be below all the html above it, just like you d expect

Practice 2 Going back to the CATS! page, let s move the last part, Stay tuned. to right side of both of the entries Here s how: Put divs around the section. Give your div a class. <div class= staytuned > </div> Cut and paste your new div up to just below the headings If you don t do this, your div will be floated to the right, but it will appear underneath everything else Make a class and set width to 120px. Set float to right..staytuned { width: 120px; float: right; }

Practice 2 continued It probably looks pretty stupid right now Lets give it a background color and a border. You ve done this before

Practice 2 continued Change the style in the div to Background color is #ffff66 Border is 2px dashed #ff3300 Padding is 5px Your CSS for this div should look like this:.float { width:150px; float:right; background-color: #ffff66; border: 2px dashed #ff3300; padding: 5px; }

Practice 2 continued The boxes from the blogs are still under the side bar Add a 150px margin to the right of each box that s not floated How do we do that?.printercat,.techkitty { margin-right: 150px; } You can add a margin to the top of the floated yellow box to move it down a little

Container layouts Sometimes when the screen is really big there s too much space on the page. How do we fix this? Give the entire page a certain size! This is called a container

Practice 3: How to do a container layout We re going to make a container that s centered In the body CSS property, center the content body { text-align: center; } Make a div around everything in the body <div id= container > </div>

Practice 3 Continued Use CSS to give the div #container a width of 780px, margin left and margin right of auto, and text aligned left #container { width: 780px; margin-left: auto; margin-right: auto; text-align: left; } If you want, you can give the container a border and a padding to make it stand out

The End Make layouts that are visually attractive and unified Look online for tutorials and more CSS properties Layout mini project!