CS3220 Web and Internet Programming Page Layout with CSS

Slides:



Advertisements
Similar presentations
15 LAYOUT Controlling the position of elements Creating site layouts Designing for different sized screens.
Advertisements

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.
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.
Creating Tables Text Tables -created by using preformatted tags. Graphical Tables - created using Table Structure with HTML.
Technologies for web publishing Ing. Václav Freylich Lecture 6.
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.
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
Page Layout & Mobile Web Using columns, grid systems, etc… to layout sites for desktops and mobile.
Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.
Technologies for web publishing Ing. Václav Freylich Lecture 7.
Neal Stublen Course Road Map  Create web page layouts using CSS  Manage CSS  Test website validity  Create navigation menus using.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  float & clear  display & visibility.
CONTROLLING Page layout
Week 5.  Normal document flow  Affecting document flow with float and position properties using CSS  Using these properties to create layouts.
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.
CHAPTER 15 Floating and Positioning. FLOAT VS. POSITION  Floating an element moves it to the left or right, allowing the following text to wrap around.
INTRODUCTION ABOUT DIV Most websites have put their content in multiple columns. Multiple columns are created by using or elements. The div element is.
Laying out Elements with CSS
Cascading Style Sheets Layout
CSCI 1720 W3.CSS – Part 1 East Tennessee State University Department of Computing CSCI 1720 Intermediate Web Design.
Web Development & Design Foundations with XHTML
Create and edit web pages 4
>> Navigation and Layouts in CSS
CS3220 Web and Internet Programming CSS Basics
CSS Layouts: Positioning and Navbars
Webpage layout using CSS
Cao Yuewen SEEM4570 Tutorial 03: CSS Cao Yuewen
Floating & Positioning
Flexbox CSCI 1720 East Tennessee State University Department of Computing CSCI 1720 Intermediate Web Design.
Putting Things Where We Want Them
CS3220 Web and Internet Programming Page Layout with CSS
CS3220 Web and Internet Programming Introduction to Bootstrap
CS3220 Web and Internet Programming Page Layout with CSS
Objectives Create a media query Work with the browser viewport
CSS part 2 Outro.
Chapter 7 Page Layout Basics Key Concepts
The Internet 10/25/11 XHTML Tables
IS333: MULTI-TIER APPLICATION DEVELOPMENT
ITI 133 HTML5 Desktop and Mobile Level I
HTML5 Level I Session III
Objectives Create a reset style sheet Explore page layout designs
HTML5 Session III Chapter 5 - How to Use the CSS Box Model for Spacing, Borders, and Backgrounds Chapter 6 - How to use CSS for page.
Controlling Layout with Style Sheets
Positioning.
MORE Cascading Style Sheets (The Positioning Model)
DynamicHTML Cascading Style Sheet Internet Technology.
Responsive Framework.
HTML – Organizing Page Content
Web Development & Design Foundations with H T M L 5
DynamicHTML Cascading Style Sheet Internet Technology.
Responsive Grid Layout with Bootstrap
SEEM4570 Tutorial 3: CSS + CSS3.0
Responsive Web Design (RWD)
Floating and Positioning
CS3220 Web and Internet Programming CSS Basics
Positioning.
CS3220 Web and Internet Programming Introduction to Bootstrap
CS3220 Web and Internet Programming CSS Basics
Web Page Layout Imran Rashid CTO at ManiWeber Technologies.
Web Development & Design Foundations with XHTML
Positioning.
Laying out Elements with CSS
Bootstrap 4 December 17, 2018.
CS3220 Web and Internet Programming More CSS
CSS Layout: Flexbox.
CS3220 Web and Internet Programming More CSS
CSc 337 Lecture 5: Grid layout.
Positioning Boxes Using CSS
CS3220 Web and Internet Programming More CSS
Presentation transcript:

CS3220 Web and Internet Programming Page Layout with CSS Chengyu Sun California State University, Los Angeles

Some Page Layouts We May Want

Using CSS Over Table for Layouts? Separation of structure and presentation Better readability Easier to change and maintain More flexible and powerful Accessibility support Better performance

Example Header Menu Content Footer

Regular HTML Page Layout The elements “flows” from left to right and top to bottom

The float Property An element is taken out of the normal flow and placed along the left or right side of its container The content of the other elements will wrap around the floated element

A float Example float: left;

The clear Property Whether an element can be next to floating elements that precede it or must be moved down below them left: no floating elements on the left right: no floating elements on the right both: no floating elements on either side

A clear Example clear: left;

The Positional Properties … position – how an element is positioned static: normal position relative: relative to the normal position absolute: relative to the containing block fixed: relative to the browser window The element is taken out of the normal flow

… The Positional Properties top, bottom, left, right – the positions of the top, bottom, left, and right side of the element z-index An element with higher z-index is displayed in front of elements with lower z-index Only works on positioned elements

CSS Layout Modes Block layout Inline layout Table layout float; multiple columns Inline layout Table layout Positioned layout Flexible box (i.e. flexbox) layout Grid layout (experimental)

Multiple Columns Example Designed for displaying text – not for creating multi-column layouts Properties column-count column-width (suggested optimal width) column-gap column-rule (can be set like borders)

Flexbox Example display: flex; flex-direction flex-wrap align-items align-content and justify-content For more on flexbox, please see A Complete Guide to Flexbox.

About Responsive Web Design (RWD) … Motivation It’s important that a website looks good on mobile devices It’s undesirable to create separate designs for different devices Responsive Web Design – design website that automatically adapts to different viewing environments

… About Responsive Web Design (RWD) A RWD example: The Boston Globe What’s required: CSS, JavaScript, layout patterns (e.g. some grid system) Libraries Bootstrap Materialize And many more

Tips About Creating Layouts in CSS