Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border 

Slides:



Advertisements
Similar presentations
Client-Side Internet and Web Programming
Advertisements

Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
9-May-15 More CSS. 2 A different emphasis CSS is the same for XML as it is for HTML and XHTML, but-- XML contains no display information If you want your.
Today’s objectives Site performance Padding, Margins, Borders
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
Tutorial 4: Creating page layout with css
Tutorial 5 Working with the Box Model. XP Objectives Understand the box model Create padding, margins, and borders Wrap text around an image Float a block-level.
CSS: Class 1 Background Images, Controlling Position of Background Images, Add Padding to Page Elements, Add Borders to Elements on a Page.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
Cascading Style Sheets Part 3 Fall, 2007 Modified by Linda Kenney Nov. 12, 2007.
Streamlining Website Development in Dreamweaver Roger L. Runquist Western Illinois University Roger L. Runquist Western Illinois University.
An Introduction to Cascading Style Sheets CSS Layout, and the CSS Box Model Nick Foxall SM5312 week 9: CSS Layout.
MORE Cascading Style Sheets (The Positioning Model)
14-Jul-15 CSS Applications to XML. 2 A different emphasis CSS is the same for XML as it is for HTML, but-- HTML already does a pretty good job of layout.
Selectors thru Borders. CSS – Cascading Style Sheets – is a way to style HTML HTML is the content base of a web page CSS provides the presentation qualities.
CSS Margins. The Margin properties define the space around elements. It is possible to use negative values to overlap content. The top, right, bottom,
Cascading Style Sheets – Block Level. Block Level Style So far we have done text-level CSS With block level CSS, we used a generic container tag Similarly.
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.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
The Missing Manual MARGINS, PADDING, & BORDERS—CHAPTER 7.
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 10: A Deeper Look at CCS- Spring 2011.
LITTLE BOXES Controlling size of boxes Box model for borders, margin and padding Displaying and hiding boxes.
Chcslonline.org Text –wrapping around Images. chcslonline.org To wrap text around an image, lets set up a style in our style sheet. open a new notepad.
INTRODUCTORY Tutorial 4 Exploring Graphic Elements and Images.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets Chapters 5-6 Color and Background Controls Border and Margin Controls.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets Part 3 Spring, 2008 Modified by Linda Kenney April 21, 2008.
Web Foundations THURSDAY, OCTOBER 3, 2013 LECTURE 6: CSS CONTINUED.
>> 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.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
CSS Class 2 -Add margins to elements on a page. -Set width and height of elements. - CSS shorthand properties for box model. -Style links. -Style tables.
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
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 Box Model  CSS properties for border  CSS properties for.
11/12/2015 Box Model Reed Crouch. 11/12/2015  HTML elements can be considered as boxes. In CSS, the term "box model" is used when referring to layout.
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
CONTROLLING Page layout
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.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
CSS - Quiz #3 Lecture Code:
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring 2016 CSS Positioning 1.
Coding with HTML {. THE BASICS { What is HTML and how can you use it to make websites?
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
CSS Box Model. What is the Box Model? Each XHTML element appearing on our page takes up a "box" or "container" of space. Each box size is affected not.
End User Computing Applied CSS: Building our course homepage Sujana Jyothi Department of Computer Science
Chapter 5 pp HTML Elements & Attributes Format Content Or Examples This Text Is A Hyperlink.
Tutorial #5 Working with the Box Model. Tutorial #4 Review - CSS Create a homework page Final Project Discussion Exam on Blackboard Styling Lists (List-style-type,
Chapter 7.  Change body and link styles  Create a drop-down menu  Change color and font styles in the menu  Create a pop-up effect using CSS  Utilize.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
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.
CSS. What does it stand for? ___________________.
CSS. What does it stand for? Cascading Style Sheet.
Laying out Elements with CSS
Cascading Style Sheets Boxes
CSS Layouts: Grouping Elements
>> The “Box” Model
CSS Applications to XML 19-Sep-18.
Cascading Style Sheets
CSS Borders and Margins.
Second CSS Lecture Applications to XML
More CSS 22-Feb-19.
CSS Applications to XML 20-May-19.
CSS Applications to XML 3-Jul-19.
Presentation transcript:

Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border  Sprites

ASSIGNMENT 1 NOTES

Tables commonly used for page layout – not recommended Proper use of table should be used for tabular data

Tables commonly used for page layout – not recommended Should not uses tables for layout.

Document structure BASIC DOCUMENT STRUCTURE

BASIC DOCUMENT STRUCTURE

Document structure Mount Olympus News body, ul, li { margin:0; padding:0;} </style HTML goes here CSS goes here BASIC DOCUMENT STRUCTURE

Document structure Prometheus Heats Things Up body, ul, li { margin:0; padding:0;} Mount Olympus News HTML does not go here

SECTION element  A general rule - SECTION appropriate if element's contents listed in the doc outline.  It’s a chunk of related content

Main news items Opinion items

Section by content.

PADDING, MARGINS, AND BORDERS CSS

Padding, Margins, and Borders  Web browsers treat all html elements as boxes.  A tag is a box with content inside (text, graphic or other html element).

Padding, Margins, and Borders HELLO WORLD! TOP PADDING RIGHT PADDING LEFT PADDING BOTTOM PADDING TOP MARGIN BOTTOM MARGIN LEFT MARGIN RIGHT MARGIN RIGHT BORDER LEFT BORDER TOP BORDER BOTTOM BORDER Other Element

Padding, Margins, and Borders  Padding: space between the content and the content’s border.  Separates content from its border. HELLO WORLD! TOP BORDER PADDING

Padding, Margins, and Borders  Border: line drawn around each edge of the box.  Can be four sides, on any single side, or any combination of sides. HELLO WORLD!

Padding, Margins, and Borders Border style values:  none: Defines no border  dotted: Defines a dotted border  dashed: Defines a dashed border  solid: Defines a solid border  double: Defines two borders.  groove: Defines a 3D grooved border.  ridge: Defines a 3D ridged border.  inset: Defines a 3D inset border.  outset: Defines a 3D outset border. HELLO WORLD!

Padding, Margins, and Borders  Background-color: fills space inside border, including padding area.  Margin separates one element from another. HelloHow are you? Padding Margin

Margins HELLO WORLD! TOP MARGIN LEFT MARGIN RIGHT MARGIN Other Element BOTTOM MARGIN

Padding, Margins, and Borders  Padding adds space between the content, and the border and keeps the content from appearing cramped inside the box.  Margins add white space (gutter) between elements giving the overall look of the page a lighter appearance.

Padding, Margins, and Borders  Four properties control padding: padding-top, padding-right, padding-bottom, and padding-left.  Four properties control margin edges: margin-top, margin-right, margin-bottom, and margin-left. margin-top : 5px; margin-right : 5px; margin-bottom : 5px; margin-left : 5px; padding-top : 5px; padding-right : 5px; padding-bottom : 5px; padding-left : 5px; padding: 10px 5px 5px 10px; margin: 0 10px 10px 20px;

Padding, Margins, and Borders margin-top : 5px; margin-right : 5px; margin-bottom : 5px; margin-left : 5px; padding-top : 5px; padding-right : 5px; padding-bottom : 5px; padding-left : 5px; padding: 10px 5px 5px 10px; margin: 0 10px 10px 20px; The order of the four values is: top, right, bottom, and left. TRouBLe - Top, Right, Bottom, and Left. Shortcut

Padding, Margins, and Borders  When value is 0, don’t need measurement unit (e.g., em, px).  Use margin: 0; instead of margin: 0px;.  When same value for all four sides, use a single value margin: 5px;

Padding, Margins, and Borders  When same value for both top and bottom and another value for left and right, use two values: margin : 0 2em;  Sets top and bottom margins to 0 ; left and right margins to 2ems.

Collapsing margins - two margins actually become one.  Bottom margin of unordered list = 30 pixels.  Top margin of a following paragraph = 20 pixels. You think: 30px + 20px = 50px spacing  BUT browser uses the largest margin (30px)  You can use padding to get around this issue.

Collapsing margins - two margins actually become one.  Browser does NOT add two vertical margins values but applies larger of the two margins. Item1 Item2 Items 3 – margin bottom 30px Paragraph – margin top 20 px 30px not 50px

Block boxes and inline boxes  Although web browsers treat every tag as a kind of box, not all boxes are alike.  Block boxes and inline boxes—that correspond to the two types of tags—block-level and inline tags.

Block boxes and inline boxes  A block-level tag creates a break before and after it.,,,, etc.  Inline tags don’t create a break before or after them.,,,

Block and inline elements  Top or bottom margins and padding do NOT increased or decrease height of inline elements.  Must use display : block; em { padding-top: 20px; padding-bottom: 20px; display: block; }

Block and inline elements  Make a block-level element act like an inline element: display: inline; ul li { display: inline; }  This is useful for setting navigation items HomeAboutProducts Home About Products

Block and inline elements  Top or bottom margins and padding do NOT increased or decrease height of inline elements.  Must use display : block; ul li a { display: inline; } HomeAboutProducts

Block and inline elements  Top or bottom margins and padding do NOT increased or decrease height of inline elements.  Must use display : block; ul li a { display: inline-block; } HomeAboutProducts