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.

Slides:



Advertisements
Similar presentations
Week 10 Creating Positioned Layouts
Advertisements

15 LAYOUT Controlling the position of elements Creating site layouts Designing for different sized screens.
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
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.
Quiz #3 - CSS Lecture Code: Get Neighbors’ URLs for MP1
Session 4: CSS Positioning Fall 2006 LIS Web Team.
SM5312 week 11: CSS Menus & Navigation Bars1 An Introduction to Cascading Style Sheets CSS Menus and Navigation Bars Nick Foxall.
With CSS, a color is most often specified by: a HEX value - like "#ff0000" an RGB value - like "rgb(255,0,0)" a color name - like "red“ Example h1.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Floating Elements CS380.
ITI 133: HTML5 Desktop and Mobile Level I
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
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)
Slide 1 of 83 Table Borders To specify table borders in CSS, use the border property. The example below specifies a black border for table, th, and td.
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.
Tutorial 4 Creating Special Effects with CSS
Technologies for web publishing Ing. Václav Freylich Lecture 7.
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.
 Website development process  CSS  Javascript.
CSS = Cascading Style Sheet CSS consists of rules to display, style and decorate HTML elements Why CSS ? – Separate decoration from HTML markup (Ex :,,…)
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
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.
Cascading Style Sheets Positioning Controls Visibility.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
Web Foundations MONDAY, OCTOBER 7, 2013 LECTURE 7: CSS LINK COLORS, INTERMEDIATE CSS.
Cascading Style Sheets Positioning Controls Visibility.
Cascading Style Sheets (CSS) Part II IT210: Web-based IT.
Cascading Style Sheets Class 3, Lecture 4 Rachel A Ober
MTA EXAM HTML5 Application Development Fundamentals.
Extra-simplified.  Only truly happen when the CSS and HTML are defined as separate files (external style sheet) Introduction The main idea of CSS is.
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.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 22, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
- 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.
THE NORMAL DOCUMENT FLOW from Quick Tip: Utilizing Normal Document Flow by Alex Rodrigues on Web tuts.
Laying out Elements with CSS
Cascading Style Sheets Layout
CSS Layouts: Positioning and Navbars
CSS Layouts: Grouping Elements
Webpage layout using CSS
Cao Yuewen SEEM4570 Tutorial 03: CSS Cao Yuewen
Floating & Positioning
Putting Things Where We Want Them
CS3220 Web and Internet Programming Page Layout with CSS
CS3220 Web and Internet Programming Page Layout with CSS
The Internet 10/25/11 XHTML Tables
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.
Styles and the Box Model
Positioning.
MORE Cascading Style Sheets (The Positioning Model)
Cascading Style Sheets
DynamicHTML Cascading Style Sheet Internet Technology.
HTML – Organizing Page Content
HTML – Organizing Page Content
DynamicHTML Cascading Style Sheet Internet Technology.
SEEM4570 Tutorial 3: CSS + CSS3.0
Floating and Positioning
CS3220 Web and Internet Programming Page Layout with CSS
Positioning.
Positioning.
The Internet 10/20/11 CSS Layout
The div Element and CSS for layout
CSc 337 Lecture 5: Grid layout.
Positioning Boxes Using CSS
CGS 3066: Web Programming and Design Fall 2019 CSS Extra
Presentation transcript:

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 break before and after it. Examples:,,, An inline element only takes up as much width as necessary, and does not force line breaks. Examples:, h1 p div span

CSS Display: Changing How an Element is Displayed li { display: inline; /* put the value “block” to make an inline element a block element */ } Display a list of links as a horizontal menu: HTML CSS JavaScript

CSS Positioning The CSS positioning properties allow you to position an element. It can also place an element behind another, and specify what should happen when an element's content is too big. Elements can be positioned using the top, bottom, left, and right properties. However, these properties will not work unless the position property is set first. They also work differently depending on the positioning method. There are four different positioning methods: Static Positioning: The default positioning, based on the normal flow of the page Fixed Positioning: An element with fixed position is positioned relative to the browser window. It will not move even if the window is scrolled Relative Positioning: A relative positioned element is positioned relative to its normal position. 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

Fixed Positioning p.pos_fixed { position: fixed; top: 30px; right: 5px; color: red; } Some text Some positioned text.

Relative Positioning h2.pos_left { position: relative; left: -20px; } h2.pos_right { position: relative; left: 20px; } Heading with no position This heading is moved left according to its normal position This heading is moved right according to its normal position

Absolute Positioning h2 { position: absolute; left: 100px; top: 150px; } This heading has an absolute position With absolute positioning, an element can be placed anywhere on a page. The heading below is placed 100px from the left of the page and 150px from the top of the page.

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 img { position: absolute; left: 0px; top: 0px; z-index: -1; } This is a heading Because the image has a z-index of -1, it will be placed behind the text.