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

Similar documents
COMM 2555 Interactive Digital Communication LAB 4

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

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

FLOATING AND POSITIONING

Assignments (4) Assessment as per Schedule (2)

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

Using CSS for page layout

The Importance of the CSS Box Model

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

CS 1100: Web Development: Client Side Coding / Fall 2016 Lab 2: More HTML and CSS

COMSC-031 Web Site Development- Part 2

Building Page Layouts

CSS worksheet. JMC 105 Drake University

Certified CSS Designer VS-1028

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

TUTORIAL MADCAP FLARE Tripane and PDF

COMS 359: Interactive Media

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

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

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

Adding CSS to your HTML

Web Design and Implementation

BIM222 Internet Programming

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

CSS Layout Part I. Web Development

Styles, Style Sheets, the Box Model and Liquid Layout

USER GUIDE. MADCAP FLARE 2017 r3. QR Codes

Appendix D CSS Properties and Values

Cascading Style Sheets (CSS)

Create a Web Page with Spry Navigation Bar. March 30, 2010

READSPEAKER ENTERPRISE HIGHLIGHTING 2.5

Block & Inline Elements

AGENDA. EMBEDDING FONTS [ Font Files & CSS font-family ] :: Online Font Converter :: ADD font-family css code to style.css

Table Basics. The structure of an table

ADOBE 9A Adobe Dreamweaver CS4 ACE.

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

Tutorial 4: Creating Special Effects with CSS

Chapter 3 Style Sheets: CSS

What is the Box Model?

Introduction to Computer Science Web Development

CSS: Layout, Floats, and More

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

Class 3 Page 1. Using DW tools to learn CSS. Intro to Web Design using Dreamweaver (VBUS 010) Instructor: Robert Lee

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

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

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

CSS. Shan-Hung Wu CS, NTHU

Internet Programming 1 ITG 212 / A

To place an element at a specific position on a page use:

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

Create a three column layout using CSS, divs and floating

Create a cool image gallery using CSS visibility and positioning property

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.

CSS THE M\SS1NG MANUAL. David Sawyer McFarland. POGUE PRESS" O'REILLr Beijing Cambridge Farnham Köln Paris Sebastopol Taipei Tokyo

Web Site Design and Development Lecture 13

Using Dreamweaver CS6

Introduction to Computer Science Web Development

AGENDA. :: Add Meta Tag for Viewport (inside of head element): :: Add Script that renders HTML5 elements for older versions of Internet Explorer

1. Cascading Style Sheet and JavaScript

Advanced Dreamweaver CS6

McMaster Brand Standard for Websites

2. Write style rules for how you d like certain elements to look.

HTML and CSS a further introduction

Layout with Layers and CSS

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


Web Engineering CSS. By Assistant Prof Malik M Ali

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

HIERARCHICAL ORGANIZATION

Using Sitecore 5.3.1

Taking Fireworks Template and Applying it to Dreamweaver

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar

Client-Side Web Technologies. CSS Part II

USING STYLESHEETS TO DESIGN A WEB SITE IN DREAMWEAVER MX 2004

Website Design (Weekday) By Alabian Solutions Ltd , 2016

Website Development with HTML5, CSS and Bootstrap

Parashar Technologies HTML Lecture Notes-4

HTML Organizing Page Content

12/9/2012. CSS Layout

THIRD EDITION. CSS Cookbook. Christopher Schmitt foreword by Dan Cederholm O'REILLY 8. Beijing Cambridge Farnham Koln Sebastopol Taipei Tokyo

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


Tutorial 3: Working with Cascading Style Sheets

Notes - CSS - Flexbox

Designing the Home Page and Creating Additional Pages

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

The figure below shows the Dreamweaver Interface.

CS193X: Web Programming Fundamentals

ORB Education Quality Teaching Resources

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

Lab Introduction to Cascading Style Sheets

UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013

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

CSS for Page Layout Robert K. Moniot 1

AGENDA :: MULTIMEDIA TOOLS :: CLASS NOTES

CS193X: Web Programming Fundamentals


CSS.

CSS Box Model. Cascading Style Sheets

Transcription:

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 1.1. Create new folder, call it lab9_your-name. 1.2. Download the file lab9.html and open it in a browser. You should see the following: Your task is to create a style.css file and add the styles explained in this lab. You will be adding your code to style.css only (which you need to create, of course). You only need to submit your style.css file. Step 2. Adding a background 2.1. First we add a background to our page. Add the following code to style.css, one line at a time: 1. Add the body selector with the empty curly braces 2. Add the background-image declaration ("declaration" is a property/value pair). Save file, refresh browser. 3. Do the same for the other 2 declarations. Try other values for both to see what happens.

Step 3. Positioning elements Make sure you have your html file open in your text editor - you need to consult it to understand what you are selecting and styling. 3.1. Let's start with the topmenu div. Let's pretend that these three links are essential at all times and, therefore, should be visible regardless of how far down the page the user scrolls. *NOTE: When is that really the case? NOT the corporate logo or menu. It is the case for an administrative toolbar when we are editing a site - that's one of the few cases when we want part of the screen to be always visible. It may help to position and style an element at the same time. 3.1.1. Let's add the following code: Consider the code you've added: 1. The top declaration ensures our selection stays in place (try to scroll down). 2. We've given it a (neutral) background, so it looks like a ribbon. 3. With fixed positioning, we must specify the width even though the element is block-level. 4. We've added some text styling. 5. And we've added a subtle border (which adds 2 pixels to the height of our ribbon). 3.1.2. Now make it horizontal, and add some padding where needed: Look carefully at the way we've specified the padding: do you remember the order? Try different values to see which one's which (top? left? bottom? right? Why did we use 0.5em for one of the values? Why not 0.7em like the opposite side? [...spoiler!...]

Because of the 2 pixel border. If we keep the values at 0.7, the text would appear to be too high (0.7em whitespace on top, 0.7em + 0.2px = approx. 0.9em on the bottom). 3.1.3. What about the links? The default color of the anchor element is blue; the default style is underlined. To change this, we need to style the a element: The second rule states that when the mouse cursor is over the element, the element's color changes to light blue. 3.2. Let's take care of the photo of ITTC. It should be place in the top right corner. We'll use absolute positioning, which takes it out of normal flow; we'll also give it a border: 3.3. Now the name of the department + university (which is the site logo, more or less). Again, positioning and styling:

Pay attention to how we group our styles to eliminate redundancy. We use relative positioning for H2 because we want it to be positioned relative to its parent div. We could do the same by using negative margins, but this way is more elegant. 3.4. Let's take care of the columns. Here's the idea: 1. We specify a width for both left and right divs (otherwise floating them won't work: they occupy 100% of their parent container (the body in our case) by default. 2. We float the left div to the left. 3. We float the right div to the right. 4. We add left and right margins to the center div, so that its content doesn't flow around/under the side bars. 5. Again, we add some styling

3.5. Finally, let's add some style to our image gallery!...and it doesn't work! That's because all the elements inside the gallery div are floated - that causes the gallery to collapse (it "can't see" the elements). The solution is simple: add the following declaration to your #gallery block: overflow: auto; That's it!

Submit your work Save your style.css file to elearning: https://bb9.uni.edu > log in with CatID > our course > Course Content > Labs > Lab 9 Congratulations, you're done!