>> CSS Layouts. Recall Properties of Box – Border (style, width, color) – Padding – Margin – Display – Background – Dimension Welcome Padding Area Border.

Slides:



Advertisements
Similar presentations
CSS Layout Crash Course An Advance CSS Tutorial. Inline vs. Block Many HTML elements have a default display setting of Block. Block elements take up the.
Advertisements

Cascading Style Sheets
Cascading Style Sheets
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.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
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:
Tutorial 4: Creating page layout with css
Murach’s ASP.NET 3.5/C#, C5© 2008, Mike Murach & Associates, Inc.Slide 1.
Lecture Cascading Style Sheets (CSS) Internal Style Sheets Classes.
CSS Basics LIS Webteam April 8, Why CSS? What’s wrong with HTML? Structure vs Style Early web design used hacks to style webpages with HTML – like.
MORE Cascading Style Sheets (The Positioning Model)
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 8: Enhancing a Web Site with Advanced CSS
CSS Box Model. What is the CSS Box Model? The “Box Model” is a tool we use to lay out our web pages in a number of individual "boxes" or "containers".
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.
Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.
ITP 104.  While you can do things like this:  Better to use styles instead:
The Characteristics of CSS
Basic Responsive Design Techniques. Let’s take a look at this basic layout. It has a header and two columns of text, in a box that is centered on the.
MCS 270 Cascading Style Sheets (CSS) Gustavus Adolphus College.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
>> Introduction to HTML: Tables. HTML is used to give websites structure 5 Basic Tags Element = Start-Tag+Content+End-Tag Heading Tags [h1-h6] Paragraph.
Neal Stublen Course Road Map  Create web page layouts using CSS  Manage CSS  Test website validity  Create navigation menus using.
Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border 
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.
CSS WORKSHOP Design Principles for Web Standards.
>> The “Box” Model. Pre-requisite Create a new project in Netbeans called Week5 Create a new html file and name it box.html Create a new css file and.
A really fairly simple guide to: mobile browser-based application development (part 2, CSS) Chris Greenhalgh G54UBI / Chris Greenhalgh
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
WEB DEVELOPMENT IMMERSIVE BUILDING PAGE LAYOUTS. 2 Box Model Scaling Positioning Boxes Box Aesthetics HTML 5 Semantic Tags CSS Resets TOPICS GENERAL ASSEMBLYWEB.
CSS Fun damentals The Document Hierarchy Element Relationships The Box Model.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS properties for margin  CSS properties for dimensions (width,
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
Page Layout CHAPTER 5 1 CHARLES WYKE-SMITH: STYLIN’ WITH CSS: A DESIGNER’S GUIDE (3 ND EDITION)
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring 2016 CSS Positioning 1.
OV Copyright © 2008 Element K Content LLC. All rights reserved. Working with Web Pages  An Introduction to Cascading Style Sheets  Format a Web.
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
04 – CSS Informatics Department Parahyangan Catholic University.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
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,
CSS.
Cascading Style Sheets Layout
>> Navigation and Layouts in CSS
Cascading Style Sheets Boxes
4.01 Cascading Style Sheets
CSS Layouts: Positioning and Navbars
Google fonts CSS box model
CSS Layouts: Grouping Elements
CS1220 Web Programming Saloni Chacha.
>> The “Box” Model
Box model.
Cascading Style Sheets (Layout)
>> CSS Layouts.
CSS Box Model.
MORE Cascading Style Sheets (The Positioning Model)
CSS and Box Model.
Floating and Positioning
CSS and Class Tools.
4.01 Cascading Style Sheets
Cascading Style Sheets
CSc 337 Lecture 5: Grid layout.
Web Programming and Design
Positioning Boxes Using CSS
Presentation transcript:

>> CSS Layouts

Recall Properties of Box – Border (style, width, color) – Padding – Margin – Display – Background – Dimension Welcome Padding Area Border Area Content Area Margin Area

Page Margin Web-Based Systems - Misbhauddin 3 Most websites online are centered How can we do this? – Wrap the whole body inside a wrapper (like a candy) – And then play with the margin values of the wrapper

Web-Based Systems - Misbhauddin 4

Centering the Wrapper Web-Based Systems - Misbhauddin 5 #wrapper { margin: 0 auto; } Note: This will not work until you define a width for the wrapper.

TRY NOW Web-Based Systems - Misbhauddin 6 Center the wrapper for the provided file Edit CSS

Issue with using width Web-Based Systems - Misbhauddin 7 #wrapper { width: 900px; margin: 0 auto; } What will happen when the browser window is smaller than the width of your wrapper? CHECK IT NOW – RESIZE YOUR BROWSER WINDOW HOW CAN WE AVOID THAT?

TRY NOW Web-Based Systems - Misbhauddin 8 Use max-width property instead of width Edit CSS Will improve the browser's handling of small windows This is important when making a site usable on mobile

TRY NOW Web-Based Systems - Misbhauddin 9 Add all the background-colors for the div tags Change the text colors of all the items Use proper text-align for all items Change the font-size of the h1 element Edit CSS

TRY NOW Web-Based Systems - Misbhauddin 10 Resize the three DIV inside the “About” div tag according to the size provided Use height and width property (Dimension) Edit CSS

Box Model Issue Web-Based Systems - Misbhauddin 11 When you specify the width and height of an element: the element can actually appear bigger than what you set. Reason: The element's border and padding will stretch out the element beyond the specified width.simple { width: 290px; }.advanced { width: 290px; padding: 30px; border-width: 10px; }

MATH Web-Based Systems - Misbhauddin 12 Hence, you will need to do some math. And for some (or maybe many) MATH is not fun Solution: CSS provides another property called “box-sizing” and if you set its value to “border-box” the padding and border of that element no longer increase its width.advanced { width: 290px; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; padding: 30px; border-width: 10px; } Box-Sizing is a new property. It is not supported by all browsers. That is why we add these. They are called Vendor Prefixes -moz- => Mozilla based browsers -webkit- => For Webkit based such as Safari

How to make the three DIV inline Web-Based Systems - Misbhauddin 13 Solution 1 – Use display inline – Not really. Remember what happened in the last class Solution 1 – Use float – What is float?

Web-Based Systems - Misbhauddin 14 This is a block of random text created to show the usage of an important property in CSS which allows creating of 2-3 column layouts which are among the most popular layouts in web design. …….. This property is called “Float”. What this property does is that it makes the element just simply float on the browser space. But using this property can be tricky. You need to set the width, margins and paddings appropriately to align them correctly together to finally come as a column layout. 400px Column Layouts

Web-Based Systems - Misbhauddin 15 Column Layouts This is a block of random text created to show the usage of an important property in CSS which allows creating of 2-3 column layouts which are among the most popular layouts in web design. …….. This property is called “Float”. What this property does is that it makes the element just simply float on the browser space. But using this property can be tricky. You need to set the width, margins and paddings appropriately to align them correctly together to finally come as a column layout. #para1 { width: 200px; } #para2 { width: 200px; } 400px

Web-Based Systems - Misbhauddin 16 Column Layouts 400px This is a block of random text created to show the usage of an important property in CSS which allows creating of 2-3 column layouts which are among the most popular layouts in web design. …….. This property is called “Float”. What this property does is that it makes the element just simply float on the browser space. But using this property can be tricky. You need to set the width, margins and paddings appropriately to align them correctly together to finally come as a column layout. #para1 { width: 200px; float: left; } #para2 { width: 200px; float: right; }

Web-Based Systems - Misbhauddin 17 Float Issue This is a block of random text created to show the usage of an important property in CSS which allows creating of 2-3 column layouts which are among the most popular layouts in web design. …….. This property is called “Float”. What this property does is that it makes the element just simply float on the browser space. But using this property can be tricky. You need to set the width, margins and paddings appropriately to align them correctly together to finally come as a column layout. #para1 { width: 200px; float: left; } #para2 { width: 200px; float: right; } #container { border 1px solid black; }

Web-Based Systems - Misbhauddin 18 This is a block of random text created to show the usage of an important property in CSS which allows creating of 2-3 column layouts which are among the most popular layouts in web design. …….. This property is called “Float”. What this property does is that it makes the element just simply float on the browser space. But using this property can be tricky. You need to set the width, margins and paddings appropriately to align them correctly together to finally come as a column layout. #para1 { width: 200px; float: left; } #para2 { width: 200px; float: right; } #container { border 1px solid black; } #clear { clear: both;} The clear div specifying the end of floating elements Floats Issue – “Clear”

TRY NOW Web-Based Systems - Misbhauddin 19 Use float to align the columns in one line Use a clear div within the About Div Edit CSS File

Want to make it easier? Using inline-block Set the display property of the container (About Div) as inline-block; – No need for clear div anymore

Announcement Reminder – Quiz-1 (Thursday 15/10/2015) – Material: HTML and CSS – Duration: 15 mins. – Starts-at: 09:05am (No extra time for late- comers)

Next on Web-based Systems Cascading Style Sheets – Navigation in CSS