>> 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.

Slides:



Advertisements
Similar presentations
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
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.
Working with Cascading Style Sheets
方框的CSS樣式.
 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.
1 Lesson Style Sheets Box Model Content (text,image,table) Margin Padding Border Box.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts 1.
Streamlining Website Development in Dreamweaver Roger L. Runquist Western Illinois University Roger L. Runquist Western Illinois University.
CSS Box Model margin border padding content 23. Box Model Properties PropertyValid valuesExample border-widththin, medium, thick, numberborder-width:
An Introduction to Cascading Style Sheets CSS Layout, and the CSS Box Model Nick Foxall SM5312 week 9: CSS Layout.
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.
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 CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
Cascading Style Sheets Billy Toy Cascading Style Sheets Syntax review How to Implement style sheets Background properties Text properties.
CSS Dvijesh Bhatt.
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.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
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.
CSS Border.
Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border 
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 10: A Deeper Look at CCS- Spring 2011.
CHAPTER 3 CSS & CSS3 อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
COMP213 – Web Interface Design
LITTLE BOXES Controlling size of boxes Box model for borders, margin and padding Displaying and hiding boxes.
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.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
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.
Part 4 Introduction to CSS. CSS Table Table Borders table, td, th { border:1px solid black; } Firstname Lastname Bader Ali Paul Manuel The example below.
Cascading Style Sheets Chapters 5-6 Color and Background Controls Border and Margin Controls.
Web Foundations THURSDAY, OCTOBER 3, 2013 LECTURE 6: CSS CONTINUED.
 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.
A really fairly simple guide to: mobile browser-based application development (part 2, CSS) Chris Greenhalgh G54UBI / Chris Greenhalgh
So far, we have looked at CSS selectors that correlate with HTML tags Now, we’ll see how you can define your own selectors using class and ID selectors.
>> More on CSS Selectors. Pre-requisite Open the file called sample.txt Copy the all the text from the file Open your browser and go to codepen.io Paste.
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
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.
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.
Tutorial 4 Creating Page Layouts with CSS
CSE 154 LECTURE 4: PAGE SECTIONS AND THE CSS BOX MODEL.
CSS - Quiz #3 Lecture Code:
Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
CIS234A Lecture 6 Instructor Greg D’Andrea. Span and Div The span and div elements are a generic means by which we can add structure to documents. The.
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.
CIS 228 The Internet 10/18/11 Grouping XHTML. CSS Selectors Rule: selector-group { property-declaration* } Selector-group: selector *, Selector: simple-selector.
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,
How CSS works Dr. Reda Salama 1. What is CSS Cascading Style Sheets Contains the rules for the presentation of HTML. + = HTMLCSSWeb Page CSS was introduced.
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 5 AND CSS Dr Mohd Soperi Mohd Zahid Semester /16.
Welcome To Website Design, Hosting And Management Prepared By Webdev Solution ip ,223,96.
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,
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 Layouts. Recall Properties of Box – Border (style, width, color) – Padding – Margin – Display – Background – Dimension Welcome Padding Area Border.
Cascading Style Sheets Boxes
( Cascading style sheet )
CSS Layouts: Grouping Elements
>> The “Box” Model
Cascading Style Sheets
CSS Borders and Margins.
Presentation transcript:

>> 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 name it style.css Link the css file to the html file –

Recall Styling in CSS – Static Styling Selectors – Type or Element | ID | Class Combining Selectors using “,” Inheritance Selectors – Descendants | Child | General Sibling | Adjacent Sibling Attribute Selectors – Dynamic Styling Pseudo-class (:) – Link Pseudo-class (link | visited | hover | active) – Form Pseudo-class (hover | focus | required | valid | invalid) Pseudo-elements (::) – first-letter | first-line

Types of Elements (display type) Web-based Systems | Misbhauddin 4 Inline Elements Block

The”BOX” Model CSS treats each element as a rectangular box – Eg. Welcome Web-Based Systems - Misbhauddin 5 Welcome Padding Area Border Area Content Area Margin Area

Border Web-Based Systems - Misbhauddin 6 Every element has a border around it Border Properties – border-width: | thin | medium | thick – border-color: | transparent – border-style: none | dotted | dashed | solid | double | groove | ridge | inset | outset Can combine border properties with the side – Eg. border-style-top, border-color-bottom border-top border-bottom border-left border-right

TRY NOW Web-Based Systems - Misbhauddin 7 Add an h1 element with “your name” Add a paragraph element with “Student at CCSIT-KFU” Set the body tag to border {1px solid black} Set the h1 tag to border {1px solid red} Set the p tag to border {1px solid blue Edit CSS File

Padding Web-Based Systems - Misbhauddin 8 Padding: Space between the content and the border Padding Properties – padding: | % Separate paddings for each side Content of the Box padding box Content padding-top padding-bottom padding-right padding-left

TRY NOW Web-Based Systems - Misbhauddin 9 Add padding to your paragraph tag Edit CSS File

Margin Web-Based Systems - Misbhauddin 10 Margin: Space between the border and other elements Margin Properties – margin: | % Separate Margin for each side Content margin margin-top margin-bottom margin-right margin-left Content border

TRY NOW Web-Based Systems - Misbhauddin 11 Increase or decrease the margin between the h1 tag and the p tag Edit CSS File

Display Web-Based Systems - Misbhauddin 12 Display Properties – display: inline | block | none Element 1 Element 2 Element 3 Element 1Element 2Element 3 Element 1 Element 3 {display: block; } {display: inline; } Element2{display: none; }

Visibility Web-Based Systems - Misbhauddin 13 Visibility Properties – visibility: visible | hidden Element 1 Element 2 Element 3 {visibility: visible; } Element 1 Element 3 Element 2{visibility: hidden; }

TRY NOW Web-Based Systems - Misbhauddin 14 Change the display of h2 to “none” Change the visibility of h2 to “hidden” Edit CSS File Add an h2 tag between the h1 and the p tag

Background Web-Based Systems - Misbhauddin 15 Using a Color – Property: background-color Using an Image – Property: background-image – Usage: background-image:url(‘myimage.png’); Using an Image – Repeat – Use the background-image property again – Use another property called background-repeat Values: repeat | repeat-x | repeat-y | no-repeat Using an Image – Position – Use the background-image property again – Use another property called background-position Values: top |bottom | center | left | right | center Can also add distance from the position in the same value Eg. background-position: 10px right;

Dimension Web-Based Systems - Misbhauddin 16 Sets the height and width of an element – width: | % | auto – height: | % | auto – overflow: hidden | visible | scroll | auto – Can also use properties to restrict minimum and maximum dimensions min-width, min-height max-width, max-height This is a block of text. The main Intention behind this box is to Demonstrate the overflow property When it comes to displaying an Element inside a box Overflow

Shorthand Properties Backgrounds – background: Borders – border: Padding & Margins – 1 value: used for all sides – 2 values: – 4 values: Note: If any value for a property is missing in the shorthand, the next one will be assumed Web-Based Systems - Misbhauddin 17

Announcement Reminder – Quiz-1 (Sunday 26/10/2014) – Material: HTML and CSS (Selectors and Styling) – Duration: 10 mins. – Starts-at: 09:35am (No extra time for late- comers)

Next on Web-based Systems Cascading Style Sheets – Layout in CSS – Navigation in CSS Assignment (Important) – Edit the profile.html file – Add your own details with your own picture