Introduction to CSS Layout

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Today CSS HTML A project.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
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.
1 Dreamweaver CS5 intermediate class by Cookie Setton Build a CSS website WITHOUT TABLES Just when you thought you were starting to understand HTML coding,
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
กระบวนวิชา 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.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Tutorial 4: Creating page layout with css
Introducing Cascading Style Sheets  Cascading Style Sheet Basics  Creating Styles  Using Styles  Manipulating Styles  Text Formatting with CSS.
Lecture Cascading Style Sheets (CSS) Internal Style Sheets Classes.
Cascading Style Sheet (CSS) Instructor: Dr. Fang (Daisy) Tang
4.01 Cascading Style Sheets
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
Tutorial 6 Creating Tables and CSS Layouts. Objectives Session 6.1 – Create a data table to display and organize data – Modify table properties and layout.
Creating A Simple Web Page. Step 1- Open Dreamweaver & Create A New Page (File New) and blank.
Advanced CSS - Page Layout. Advanced CSS  Compound Selectors:  Is a Dreamweaver term, not a CSS term.  Describes more advanced types of selectors such.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Web Page Basics XHTML & CSS 1. Planning Decide on topic or research the topic given to you. Decide on your colour scheme. Use
CSS Sprites. What are sprites? In the early days of video games, memory for graphics was very low. So to make things load quickly and make graphics look.
Web Development & Design Foundations with XHTML
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Doman’s Sections Information in this presentation includes text and images from
MCS 270 Cascading Style Sheets (CSS) Gustavus Adolphus College.
IDs versus Classes Naming Your Tags for Maximum Functionality.
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit E Formatting with Cascading Style Sheets.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
FTS: The Perils and Promise of Computing Cascading Style Sheets (CSS) Gustavus Adolphus College Fall 2012.
Macromedia Dreamweaver 8-- Illustrated Introductory 1 Macromedia Dreamweaver 8 Unit D Formatting Text and Using Cascading Style Sheets.
Dreamweaver CS4 Concepts and Techniques Chapter 9 Using Spry to Create Interactive Web Pages.
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
Lesson 03 // Cascading Style Sheets. CSS Stands for Cascading Style Sheets. We’ll be using a combination of Html and CSS to create websites. CSS is a.
IT Introduction to Website Development Welcome!
CSW131 Steven Battilana 1 CSW 131 – Chapter 6 Laying Out Pages Prepared by Prof. B. for use with Teach Yourself Visually Web Design by Ron Huddleston,
Web Foundations TUESDAY, NOVEMBER 19, 2013 LECTURE 31: DREAMWEAVER: MODIFY MENU AND PROPERTY PANEL.
Introducing Cascading Style Sheets. Cascading Style Sheet Basics  Cascading Style Sheet Basics  Creating Styles  Using Styles  Manipulating Styles.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
FUNDAMENTALS OF HTML, XHTML & CSS Lesson 4. THE OBJECTIVES -  In this lesson you will begin coding in HTML to provide the structure  You will learn.
Web Design Part I. Click Menu Site to create a new site root.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Web Development & Design Foundations with HTML5 7th Edition
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
REEM ALMOTIRI Information Technology Department Majmaah University.
Microsoft Expression Web-Illustrated Unit F: Enhancing a Design with CSS.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
1 Preparation for site Create a folder in MyDocuments: beavercheese. Create a subfolder, images Classes, career, DW beginner Download.
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
Unit 3 - Review. Topics 1. Tag, Attribute, Value 2. CSS Rule Syntax + link 3. Categories of Selectors 4. Inline vs Block Tags 5. CSS Layout 6. CSS Box.
Introduction to CSS Layout
4.01 Cascading Style Sheets
Formatting Text with CSS
Creating Page Layouts with CSS
Fundamentals of HTML, XHTML & CSS
Advanced CSS Layout Lesson 5.
Cascading Style Sheets (Layout)
Advanced CSS Layout Lesson 5.
4.01 Cascading Style Sheets
Introduction to Cascading Style Sheets (CSS)
Presentation transcript:

Introduction to CSS Layout Lesson 7

What you’ll learn in this lesson - Understanding CSS reset file An overview of CSS layout options How to use margins and padding to add space to your page Working with the Float and clear properties What you’ll learn in this lesson -

Types of Layout there are two types of layouts – Fixed-width and Flexible or Responsive This demo however, will teach a two column fixed-width layout   Types of Layout

Learn to distinguish between areas masthead m a i n n a v main content footer Inner wrap wrap   sidebar Learn to distinguish between areas

To get Started Log into your server folder-    1. Double-click TadsTees folder 2. Right-click and create a New Folder and name it ‘layout’ 2. Copy the images folder and styles.css file into it 3. We will download 2 other files one at a time (very important)   Visit my website > Lesson files Menu > Scroll to lesson 7 resources > Point and right click 07_instructor-Layoutstart.html > choose Save link as from a list of options > navigate to Tad’s tees folder > click save. 4. Delete the ‘1’ from the file name To get Started

See Reset file in action 5. Right-click 07_instructor-Layoutstart.html and Open with BBEdit and Preview in browser 6. This file has no styles attached to it. The styles (h1, h2, h3, p, unordered list, font style, font size, line spacing, margins, padding) on this page are determined by the browser you used. 7. Now save Reset into the layout folder (follow the steps for the 07_instru…. file 8. Delete the ‘1’ from the file name

The Purpose of a Reset file 9. Now Preview 07_instructor-Layoutstart.html in the browser The RESET file removed the browser’s default styling. The benefit of a reset file is that provides a foundation for the designer to begin adding their own rules. Therefore, A CSS Reset file is an external style sheet that is added to a page that includes multiple rules to set the margins and paddings of HTML elements to zero.

Locating div layout styles Close the browser and in BBEdit, click 07_instructor_layoutstart.html This file contains the div element structure and some content. Scroll-down and locate the beginning and ending of each div element. We shall be adding the logo image that we inserted in the index.html We will also be writing rules for div layout styles for the IDs: #wrap, #masthead, #mainnav, #mainnav list, #sidebar, #main, and #footer Locating div layout styles

Let’s begin CSS styling the layout In 07_Instru…. file, click after the opening <style> tag and press Enter/Return. Type the following style for the wrap id. #wrap { background-color:#E0B3B9; width:960px; border:thin solid black; margin:0 auto; } Command plus S to save and preview in the browser

The difference between a normal rule & a contextual rule  If you write a rule for h2 as follows –   h2 { color: red; } all the h2s on the page will be targeted. But if you write the rule as a div tag #sidebar h2 { only the h2s that are within the div named ‘sidebar’ will be targeted. Repeat the above and change the div name from sidebar to ‘main’ and see the h2 in the main column will be target.

Inserting the t-shirt logo We are going to place the t-shirt logo inside the masthead.  Scroll down to <div id="masthead">. Click once after the opening masthead div id and press Enter And type the address for the logo <img src="images/tadstees_logo.png" alt="Tads Tees Logo" width="260" height="320" /> Command plus S to save and preview in the browser.

Continuing with CSS styling of the layout Press Enter after the closing curly bracket and type a style for masthead -   #masthead { background-color:#FFF; } Command plus S to save and preview in the browser to see the result Continuing with CSS styling of the layout

Continuing with CSS styling of the layout Scroll back up into the internal css and click once after the last curly bracket and press enter and type the following - #mainnav { background-color:#C2C895; height:40px; }   Command plus S to save and preview Continuing with CSS styling of the layout

Continuing with CSS styling of the layout Click after the last curly bracket in the internal css then press enter and type the following - #sidebar { float:left; width:300px; background-color:#CCC; }   Command plus S to save and preview Continuing with CSS styling of the layout

Continuing with CSS styling of the layout Click once after the last curly bracket and press enter and type the following -   #main { width:600px; float:right; background-color:#ADA446; } Command plus S to save and preview in the browser to see the result Continuing with CSS styling of the layout

Continuing with CSS styling of the layout   And lastly, Click once after the last closing curly bracket and press enter and type the following - #footer { clear:both; background-color:#BA2B22; } Continuing with CSS styling of the layout

Continuing with CSS styling of the layout Now, I’d like you to pay attention to the main area. Nothing is styled. let’s go to the styles.css and copy all the styles that we’d written in the previous demo session and paste into the 07_instructor_layoutstart.html   h1 { color: #e8662d; font-size: 1.5em; margin-bottom: 0.60em; } body { font-family:"Trebuchet MS", Tahoma, Arial, sans-serif; font-size: 100%; p { font-size: 0.875em; h2 { font-size: 1.25em; ul { ul li { margin-top: 1em; Command plus S to save and preview in the browser Continuing with CSS styling of the layout

Continuing with CSS styling of the layout Now let’s write the style for the mainnav li which by the way is not there yet. Explain the mainnav li (not there yet) and get them to write the rule for it first as follows –   #mainnav li { float: left; width: 120px; height: 25px; background-color: #ccc; text-align: center; border-left: 1px black solid; border-right: 1px black solid; list-style: none; } Pay attention to the style you just wrote for the mainnav li Continuing with CSS styling of the layout

Continuing with CSS styling of the layout Now to write the list items, scroll down and locate the <div id="mainnav"> then select (highlight) the words ‘Placeholder text’ and write the following -   <ul> <li><a href="index.html">Home</a></li> <li><a href="about.html">About</a></li> <li><a href="tshirts.html">T Shirts</a></li> <li><a href="dyo.html">Design Your Own</a></li> <li><a href="forum.html">Forum</a></li> </ul> Delete the Reset file Link tag for the styles.css file to show the styles Continuing with CSS styling of the layout

This concludes lesson 7 tutorial Assignments to complete for lesson 7 are – Listen to the video tutorial Read and follow the steps to complete the Lesson 7 project You will be tested for the Review Qs on Schoology