CSS and Box Model.

Slides:



Advertisements
Similar presentations
Slide 1. Murach's HTML5 and CSS3, C6 Slide 2 Layout Control is a critical issue in any website/pages design. Traditionally and conveniently (but not satisfactorily)
Advertisements

Cascading Style Sheets
Cascading Style Sheets
Today CSS HTML A project.
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
CSS. Intro to CSS Cascading Style Sheets – styles and enhances appearance of webpage.css extension.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
Diliev.com & pLOVEdiv.com  DIliev.com.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Unit 20 - Client Side Customisation of Web Pages
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
4.01 Cascading Style Sheets
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.
ITP 104.  While you can do things like this:  Better to use styles instead:
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Css. Definition Cascading style sheet (CSS) Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Finishing your site HTML and css 2012 Brian Davison.
 Word doc for you to download › Link at the beginning of class › 10 Questions › Answers to be added inline  Post to Sakai when completed › No resubmits.
Tutorial 5 Working with Tables and Columns
Tutorial 5 Working with Tables and Columns
Lecture 2 - HTML and CSS Review SFDV3011 – Advanced Web Development 1.
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
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.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
>> CSS Layouts. Recall Properties of Box – Border (style, width, color) – Padding – Margin – Display – Background – Dimension Welcome Padding Area Border.
CSS.
Laying out Elements with CSS
Cascading Style Sheets (CSS) Internal Style Sheets Classes
Cascading Style Sheets
>> Navigation and Layouts in CSS
4.01 Cascading Style Sheets
CSS Layouts: Positioning and Navbars
Google fonts CSS box model
CSS Layouts: Grouping Elements
Unit 3 - Review.
CS1220 Web Programming Saloni Chacha.
Tutorial 5 Working with Tables and Columns
Box model.
Cascading Style Sheets (Layout)
>> CSS Layouts.
Cascading Style Sheets
Objectives Create a reset style sheet Explore page layout designs
Styles and the Box Model
TOPICS Chrome Dev Tools Process for Building a Static Website
CSS Borders and Margins.
CSS Box Model.
Box model, spacing, borders, backgrounds
Software Engineering for Internet Applications
Cascading Style Sheets
DynamicHTML Cascading Style Sheet Internet Technology.
Float Property Elements that seem to “float" on the right or left side of either the browser window or another element are often configured using.
Responsive Framework.
What are Cascading Stylesheets (CSS)?
Web Development & Design Foundations with H T M L 5
Cascading Style Sheets™ (CSS)
DynamicHTML Cascading Style Sheet Internet Technology.
How to use the CSS box model for spacing, borders, and backgrounds
Floating and Positioning
Web Design and Development
CSS and Class Tools.
Principles of Web Design 5th Edition
Laying out Elements with CSS
4.01 Cascading Style Sheets
Web Client Side Technologies Raneem Qaddoura
Presentation transcript:

CSS and Box Model

Topics Quick Tips and CSS style priorities Divisions – The Design Process Box sizing Practice - MockUp Implementation

CSS Tips image { margin-left: auto; } float:right; To center an element, other than text, use the margin attributes. image { margin-left: auto; }   Float can be used for alignment, but it is unpredictable because it is highly responsive to the size of a screen. float:right; Use clear to ensure that nothing else appears to the left/right of an element. table { clear: both; margin-left: 100px; width: 150px;

CSS Style Priorities It matters where you define the rules and in what order they are applied. Styles can be defined in different places. A higher-priority rule will overwrite a previous definition.  

Priority Rule 1: Inline Style Rule Example: <li> <a href= "http://www.Redlands.edu" style="color: #90a184;" title="About Us">About Us </a> </li> NOTE: This style should usually be avoided.

Priority Rule 2: Style Rule Embedded in HTML Example: <head> <title>A Simple Webpage</title> <style> table, th, td { border: 1px solid black; } </style>   </head> NOTE: Use only for very small projects.

Priority Rule 3: Stylesheet in a separate CSS file IDEAL

Priority Rule 4: Style Used by a Browser Different browsers have slightly different styles. Browsers use default stylesheets to determine how to display HTML elements.   Because these rules differ sometimes between browsers, there are efforts to promote consistency in styles across browsers.

Final Statement on Priority Rules If an object has multiple, overlapping CSS rules defined for it, the one with the higher priority will take effect.

Divisions in a Design A webpage is a collection of objects. When designing, objects should be placed in divisions. div represents a division class. div is used to divide a page into objects, box model elements. Goal: Position elements so that they can be easily rearranged if we decide to give users a different experience.

Carve a webpage mockup into box elements

Every object on a web page is modeled as a box

Box Model size = width + padding + border actual visible/rendered width of an element's box height + padding + border actual visible/rendered height of an element's box

Box Sizing * { -webkit-box-sizing: border-box; The box-sizing property can make CSS layouts more intuitive. The box-sizing property has a common value called border-box. Every current browser supports box-sizing: border-box; If you need to support older versions of Safari (< 5.1), Chrome (< 10), and Firefox (< 29), you should include the prefixes -webkit and -moz: * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }

Lab 4 Exercise 1 How is this webpage carved up?