PAGE LAYOUT - 2.  The div tag equipped with CSS rules produces good looking pages.  With CSS, the div tag can easily be positioned anywhere on the page.

Slides:



Advertisements
Similar presentations
Week 10 Creating Positioned Layouts
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.
Presenter: James Huang Date: Sept. 26,  Introduction  Basics  Lists  Links  Forms  CSS 2.
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.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
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:
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.
MORE Cascading Style Sheets (The Positioning Model)
Page Layout & Mobile Web Using columns, grid systems, etc… to layout sites for desktops and mobile.
Cascading Style Sheets CSS. CSS Positioning Normal Flow Top -> bottom | left -> right Arranged in the order they appear in the code make room for one.
Cascading Style Sheets CSS. div … Used like a container to group content Gives context to the elements in the grouping Give it a descriptive name with.
HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.
Copyright © Terry Felke-Morris CSS Flow & Positioning 1 Copyright © Terry Felke-Morris.
CSS Netcentric. What is CSS O CSS stands for Cascading Style Sheets O Styles define how to display HTML elements O Styles were added to HTML 4.0 to solve.
THE BOX MODEL Putting layouts together with CSS. The Box Model  How would you describe a box?  Container?  Tags or elements are “containers”  puts.
Layout with Styles Castro Chapter 11. Tables vs. CSS You can produce “liquid layouts” (layouts that stretch as the browser is resized) using tables or.
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
Web Foundations MONDAY, OCTOBER 7, 2013 LECTURE 7: CSS LINK COLORS, INTERMEDIATE CSS.
CSS Positioning & Layout Creating layouts and controlling elements.
CONTROLLING Page layout
IN THE DOCUMENT OBJECT MODEL, EACH LINE OF HTML IS AN ELEMENT (AN OBJECT), ABLE TO HAVE ATTRIBUTES, PROPERTIES AND VALUES. CSS TELLS THE BROWSER HOW TO.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
Today’s objectives  Announcements  Positioning  Measurement units.
HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.
Ch. 2. HTML 1. HTML? 2  Tim Berner-Lee first proposed (1981) and coded (1991)  HTML: HyperText Markup Language  Web browser 용  W3C (World Wide Web.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
Mimi Opkins.  One of the major benefits of using CSS is that you’re not forced to lay your sites out in tables.  The layout possibilities of CSS give.
Tutorial 4 Using CSS for Page Layout. Objectives Session 4.1 – Explore CSS layout – Compare types of floating layouts – Examine code for CSS layouts –
Laying out Elements with CSS
Cascading Style Sheets Layout
Web Development & Design Foundations with HTML5 7th Edition
Web Development & Design Foundations with XHTML
CSS Layouts: Positioning and Navbars
CSS Layouts: Grouping Elements
Webpage layout using CSS
Internet & Web Engineering Course Code:CS-228 Credit Hours (3+1) Lab 4a Block Level Elements In HTML Instructor: Muhammad Zeeshan Haider Ali Blog.
Cascading Style Sheets
Cao Yuewen SEEM4570 Tutorial 03: CSS Cao Yuewen
Floating & Positioning
Putting Things Where We Want Them
Web Development & Design Foundations with HTML5 7th Edition
Web Development & Design Foundations with HTML5 8th Edition
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Objectives Create a reset style sheet Explore page layout designs
6 Layout.
Creating Layouts Using CSS
Styles and the Box Model
Controlling Layout with Style Sheets
Positioning.
MORE Cascading Style Sheets (The Positioning Model)
DynamicHTML Cascading Style Sheet Internet Technology.
Tutorial 6 Creating Dynamic Pages
HTML – Organizing Page Content
HTML – Organizing Page Content
Cascading Style Sheets
Block-level Elements A block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as.
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with H T M L 5
Cascading Style Sheets™ (CSS)
DynamicHTML Cascading Style Sheet Internet Technology.
Floating and Positioning
Positioning.
Web Development & Design Foundations with XHTML
Positioning.
Laying out Elements with CSS
The div Element and CSS for layout
Positioning Boxes Using CSS
CGS 3066: Web Programming and Design Fall 2019 CSS Extra
Presentation transcript:

PAGE LAYOUT - 2

 The div tag equipped with CSS rules produces good looking pages.  With CSS, the div tag can easily be positioned anywhere on the page.  For instance:  …  This will position the tag 150px from browser top and 50px from left.

 CSS offers four types of position for div tags (and other block elements)  Static positioning A static positioned element is always positioned according to the normal flow of the page. Static positioned elements are not affected by the top, bottom, left, and right properties.

 Fixed Positioning An element with fixed position is positioned relative to the browser window. It will not move even if the window is scrolled Eg p.pos_fixed { position: fixed; top: 30px; right: 5px; }

Fixed positioned elements are removed from the normal flow. The document and other elements behave like the fixed positioned element does not exist. Fixed positioned elements can overlap other elements

 Relative Positioning A relative positioned element is positioned relative to its normal position as laid out by the browser. Eg. h2.pos_left { position: relative; left: -20px; } The content of relatively positioned elements can be moved and overlap other elements, but the reserved space for the element is still preserved in the normal flow.

 Absolute Positioning An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is. Absolutely positioned elements are removed from the normal flow. The document and other elements behave like the absolutely positioned element does not exist. Absolutely positioned elements can overlap other elements. Eg. h2 { position: absolute; left: 100px; top: 150px; }

 Overlapping Elements  When elements are positioned outside the normal flow, they can overlap other elements.  The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others).  An element can have a positive or negative stack order.

 Overlapping Elements (cont…)  An element with greater stack order is always in front of an element with a lower stack order.  Note: If two positioned elements overlap without a z- index specified, the element positioned last in the HTML code will be shown on top.  Eg.  img { position: absolute; left: 0px; top: 0px; z-index: -1;//set images to be placed behind }

#header { background-color:black; color:white; text-align:center; padding:5px; } #nav { line-height:30px; background-color:#eeeeee; height:300px; width:100px; float:left; padding:5px; } #section { width:350px; float:left; padding:10px; } #footer { background-color:black; color:white; clear:both; text-align:center; padding:5px; }

City Gallery London Paris Tokyo London London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants. Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium. Copyright &copy W3Schools.com

 Useful CSS rules with div layout  Float (right, left): specify how the div floats relative to other content. Normally divs starts on left as they are block elements  Position (absolute, fixed, relative): used to position the div where required on the page  Height/width: unless specified, the div will only take as much space as required to display its content.

 Useful CSS rules with div layout  Overflow: useful when width and height are specified. This specify whether scrollbars should be added or not when content exceeds the available space in the div.

INTRODUCTION TO BASIC FORMS

 HTML forms are used to collect user input.  The element defines an HTML form  HTML forms contain form elements.  Form elements are different types of input elements: checkboxes, radio buttons, submit buttons, textboxes etc

 defines a one-line input field for text input:  Example First name: Last name:

 defines a radio button.  Radio buttons let a user select ONE of a limited number of choices:  Example Male Female

 defines a button for submitting a form to a form-handler.  The form-handler is typically a server page with a script for processing input data.  The form-handler is specified in the form's action attribute:

 Example First name: Last name:

 To be submitted correctly, each input field must have a name attribute.  Example First name: Last name:

 The name attribute is important for the processing script as it uses the name of the input control to retrieve its value.

 The action attribute defines the action to be performed when the form is submitted.  The common way to submit a form to a server, is by using a submit button.  Normally, the form is submitted to a web page on a web server.  In the example above, a server-side script is specified to handle the submitted form:

 If the action attribute is omitted, the action is set to the current page as a default handler.

 The method attribute specifies the HTTP method (GET or POST) to be used when submitting the forms:

 When to Use GET?  You can use GET (the default method): If the form submission is passive (like a search engine query), and without sensitive information. When you use GET, the form data will be visible in the page address:  When to Use POST?  You should use POST: If the form is updating data, or includes sensitive information (password). POST offers better security because the submitted data is not visible in the page address.

 An HTML element, with all possible attributes set, will look like this:  Example

 For more insights into attributes of an input element of a form, visit w3Schools on the link:  ributes.asp