CSS - Quiz #3 Lecture Code:

Slides:



Advertisements
Similar presentations
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.
Advertisements

Quiz #3 - CSS Lecture Code: Get Neighbors’ URLs for MP1
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
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 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.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
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.
CSS II Digital Media: Communication and design IT University of Copenhagen.
MORE Cascading Style Sheets (The Positioning Model)
4.01 Cascading Style Sheets
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.
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
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.
Basics of Smarajit Dasgupta.
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
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.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
Neal Stublen Course Road Map  Create web page layouts using CSS  Manage CSS  Test website validity  Create navigation menus using.
Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border 
CSS - Quiz #4 Lecture Code:
Today’s Agenda Advanced CSS Techniques Floating Z-index Centering Sliding Doors Fluid Layouts CSS3 Advanced CSS Lab Mini Project #2.
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.
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.
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.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
THE BOX MODEL Putting layouts together with CSS. The Box Model  How would you describe a box?  Container?  Tags or elements are “containers”  puts.
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
CSS Fun damentals The Document Hierarchy Element Relationships The Box Model.
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.
Copyright © Osmosys O S M O S Y SO S M O S Y S D e p l o y i n g E x p e r i e n c e & E x p e r t i s e™ CSS Training.
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
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring 2016 CSS Positioning 1.
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.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
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.
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.
Cascading Style Sheets Layout
Webpage layout using CSS
>> The “Box” Model
CSS Applications to XML 19-Sep-18.
Cascading Style Sheets
Styles and the Box Model
CSS Borders and Margins.
Second CSS Lecture Applications to XML
MORE Cascading Style Sheets (The Positioning Model)
More CSS 22-Feb-19.
CSS Applications to XML 20-May-19.
CSS Applications to XML 3-Jul-19.
Presentation transcript:

CSS - Quiz #3 Lecture Code: 170375 http://decal.aw-industries.com Web Design: Basic to Advanced Techniques

Today’s Agenda Web Design: Basic to Advanced Techniques Quiz & Attendance Announcements Revisit Absolute / Relative URLs CSS Selector Motivation CSS / Photoshop Layouts – Part 1 Finish Quiz & Attendance Lab Web Design: Basic to Advanced Techniques

Announcements Web Design: Basic to Advanced Techniques Mini Project 2 due tonight by 11:59PM Battleship or Instant Messenger? Need help? Post in the Chatroom! Did you finish a project early? Help others in the Chatroom! Confused about course material? Email me and take advantage of lab after class. Web Design: Basic to Advanced Techniques

Absolute vs. Relative URLs Are you linking to a different domain? yes http://B.com/redSmiley.jpg Use absolute URL no A.com B.com Is the item you’re linking to in a sub-folder of or in the same folder as the html document? Absolute URL yes no folderN/redSmiley.jpg Use relative URL /folderB/redSmiley.jpg Use root relative URL A.com A.com /folderA /folderA /folderB … Relative URL /folderN Root Relative URL

CSS Selector Motivation Say we want to style all the links that appear inside paragraphs of class .myPara HTML <p class=“myPara”> <a class=“pLink”></a> </p> CSS .pLink { } HTML <p class=“myPara”> <a ></a> <a></a> </p> CSS .myPara a { } We want to be as efficient as possible with our coding to keep file sizes down.

Basic to Advanced Techniques Web Design: Basic to Advanced Techniques Spring 2010 Tuesdays 7-8pm 200 Sutardja-Dai Hall CSS/Photoshop Layouts – Part 1 Web Design: Basic to Advanced Techniques

Building Our Layout Toolbox HTML Element: border: 1px solid #000000; <div></div> background-color: #000000; CSS Attributes: background-image: url(image.gif); background-repeat display: block; background-position block height: 10px; inline Also width inline-block float: left; position: absolute; clear: right; absolute z-index: 100; relative Also top/bottom, left/right margin: 10px 10px; Also padding

div Element How exactly is CSS doing this? What’s being styled? Without CSS With CSS How exactly is CSS doing this? What’s being styled?

div Element …continued View Source Source Code for Menu <div > <div> <div></div> <div></div> <div></div> <div></div> <div></div> </div> </div >

div Element …continued div’s are our general layout building blocks/containers Used to logically group HTML elements Separate regions of code into functional regions “these HTML elements make up the menu system” Like span’s they have no visual effect on our HTML documents by themselves span’s are inline elements div’s are block elements What happens when we wrap a set of elements in div tags?

div Element …continued <div id=“menu”> <h3>Menu</h3> <a></a> </div> <h3>Menu</h3> <a></a> <a>print story</a> <h1>News Story</h1> <p> </p> <div id=“newsStory”> <a>print story</a> <h1>News Story</h1> <p> <a></a> </p> </div>

Spot the div’s Whenever you see multiple HTML elements behaving in unison, suspect a div.

CSS’n div’s <div id=“everything”> <div id=“arrow”></div> <div id=“menu”> …many links </div> <div id=“content”> <div class=“message”></div> …more messages

CSS’n div’s …continued After we break up our layout into div’s we use CSS to position and style them.

CSS Property: display Example: Common Values: a { display: block; } Common Values: block inline none Hides object inline-block (not supported in IE 6, inconsistent IE 7) Allows block level elements to be placed next to each other For compatibility: use floats instead Valid HTML: Still don’t nest block elements in inline elements. HTML syntax independent of CSS. block inline inline

CSS Properties: height, width Can only be set on block level elements and a few inline elements such as <img /> Example: div { width: 100px; height: 100px; } div { width: 100%; height: 100%; } Common Values: Pixels: 20px Percentage of parent: 100% Not set/auto: width of contents height: 100px; width: 100px;

CSS Properties: height, width …continued width: 100px; width: 100%; width: 100px; height: 100%; height: 100px; height: 100px; height: 100%; height: 100px; height: auto; width: 100px; width: auto;

CSS Property: border Example: Common Values: div { border: 1px solid #000000; } div { border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; } Common Values: Border width: 1px Border style: solid Border color: #000000 div solid ridge dotted inset dashed outset double groove div { border: 1px solid #000000; }

CSS Properties: margin, padding Margin: space between this object and others Padding: space between the objects border and contents Example: div { margin: 5px 10px; } div { margin: 5px 10px 5px 10px; } Order: top, right, bottom, left div { margin-top: 5px; margin-bottom: 5px; margin-left: 10px; margin-right: 10px; } Padding has same syntax Common Values: Pixels: 10px Div_1 margin Div_2 padding

CSS Properties: position Example: div { position: absolute; } Common Values: absolute Removes object from flow of document. Object takes up no space. Relative to closest parent who has its position set. If no parent qualifies, relative to document boundaries. relative Relative to the objects natural location. fixed Relative to browser window’s boundaries. static Don’t typically use this because it is already the default behavior.

CSS Properties: top/bottom, left/right Used in conjunction with position Example: div { position: absolute; top: 0px; left: 0px; } Common Values: Pixels: 10px

position Document Flow code: <span>A</span><div>B</div><span>C</span> div { position: static; } div { position: relative; } div { position: absolute; } or div { position: static; } span: “A” span: “A” span: “A” span: “C” div: “B” div: “B” div: “B” span: “C” span: “C”

top & left Effects div { position: static; top: 10px; left: 10px; } position: relative; top: 10px; left: 10px; } div { position: absolute; top: 10px; left: 10px; } top: 0px; left: 0px; top: 0px; left: 0px; span: “A” span: “A” top: 0px; left: 0px; span: “A” 10px span: “C” div: “B” 10px div: “B” div: “B” 10px div: “B” div: “B” 10px span: “C” span: “C”

A A B B absolute References code: <div id=“A”><div id=“B”></div></div> top: 0px; left: 0px; top: 0px; left: 0px; A A B B div { position: absolute; top: 10px; left: 10px; } div { position: absolute; } #A { top: 10px; left: 10px; } #B { bottom: 10px; right: 10px; }

absolute vs. fixed Please see included absolute_vs_fixed.html file for demo.

CSS Properties: float Effect on itself: Effect on others: A floated object moves left or right (depending on the value of float) until it encounters another floated object or its container’s boundaries. Effect on others: Like water flows around a floating item, adjacent objects flow around an object that has its float property set Also a type of positioning but not set with position. Can only be set if the position is relative, static or not set. Should set width and height of object when using float, else behavior can be unpredictable. Example: div { float: left; width: 100px; height: 100px; } Common Values: left right none

CSS Properties: clear Used to specify behavior of object interacting with a floated object clear forces the object to appear after the floated object ( if it’s a left float, right float, or both types ) Example: p { clear: left; } Common Values: left right both none

float & clear Demo Please see included float.html file for demo.

CSS Property: z-index Object must have position set to relative, absolute, or fixed. If not set, later elements have higher z-index’s that earlier ones. Higher numbers on top of lower numbers. Example: div { position: absolute; z-index: 100; } Common Values: positive integers later default 100 99 default 99 100 earlier

CSS - Quiz #3 Lecture Code: 170375 Then… Lab http://decal.aw-industries.com Web Design: Basic to Advanced Techniques