CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
Advertisements

Tutorial 4: Creating page layout with css
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
CSS: Class 1 Background Images, Controlling Position of Background Images, Add Padding to Page Elements, Add Borders to Elements on a Page.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
CASCADING STYLE SHEETS CSS. 2 What CSS means?  CSS is an extension to basic HTML that allows you to style your web pages.  It separates the part that.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts 1.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
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)
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.
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.
Cascading Style Sheets Billy Toy Cascading Style Sheets Syntax review How to Implement style sheets Background properties Text properties.
LING 408/508: Programming for Linguists
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.
Principles of Web Design 6 th Edition Chapter 10 – Data Tables.
CSCI N241: Fundamentals of Web Design Copyright ©2006  Department of Computer & Information Science Using the Box Model, & Elements.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
WORKING WITH CASCADING
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
MCS 270 Cascading Style Sheets (CSS) Gustavus Adolphus College.
Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border 
Cascading Style Sheet Bayu Priyambadha, S.Kom. Definition Cascading Style Sheets (CSS) form the presentation layer of the user interface. –Structure (HTML)
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 10: A Deeper Look at CCS- Spring 2011.
CHAPTER 3 CSS & CSS3 อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
COMP213 – Web Interface Design
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
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.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
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.
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.
CSS WORKSHOP Design Principles for Web Standards.
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.
 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 with XHTML Please use speaker notes for additional information!
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
LING 408/508: Programming for Linguists Lecture 10 September 30 th.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS Box Model  CSS properties for border  CSS properties for.
CIS234A Lecture 5 Instructor Greg D’Andrea. Font Styles Review Font-Family: generic family, font family Font-Size: em, pt, px, %, mm, cm, in Font-Style:
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.
CSS – Cascading Style Sheets
Today’s objectives Layouts | floats Measurement units Type properties
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
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.
JavaScript and 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.
Review First – on your own... Go to Day 5 Grab the contents of position review file Place in DW Add styles to recreate – get something close to
Cascading Style Sheet (CSS) SAMPLE IT133 Pengembangan Web.
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
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,
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
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.
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,
Laying out Elements with CSS
Presentation transcript:

CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles

What we will cover… Positioning (More) ◦ Columns ◦ Float ◦ Shorthand The CS1 Server ◦ Accounts ◦ Linux Basics

Positioning Review ◦ Box Model ◦ Floats

The Box Model HTML Displays Flow Content as a box ◦ Called the box model  Height, Width (content)  Margin  Between box and rest of page  Padding  Between box and content  Border  Perimeter of Box  Outline  Outside of Box

The Box Model (2) Some Sort of Content… Width Height Margin Padding BorderOutline Top RightLeft Bottom

The Box Model (3) Height / Width ◦ Set the height / width of content area  Values:  px  Absolute (defined) size in pixels  %  Percentage of containing block (relative size)  auto  Automatically resizes the box based on the height / width of its containing block (default)  See height/widthtest.html

Height / Width (2) ◦ Min-width / min-height  Sets the minimum values of the content area for a block (flow content)  Percent (%)  Absolute (pixels)  None (no minimum) ◦ Max-width / max-height  Sets the maximum values for the content area for a block  Relative (%)  Absolute (pixels)  None (no max)

Margins Set offsets from the containing block ◦ (No container = from the page) Can set from different sides:  margin-top, margin-right, margin-bottom, margin-left ◦ Values  Px (pixels)  em (relative to default text value)  Pt  Auto (center the block; define left and right margins)

Margins (2) Note: ◦ It’s good practice to set top and bottom margins for all your elements  Different browsers set different default margins ◦ Margins can collapse  When there is a bottom margin set for an element, and a top margin set for the element below it  The smaller margin is ignored!  Can use padding to take care of this See margintest.html

Padding Defines space between the border and content Can define different sides: ◦ padding-top, padding-right, padding-bottom, padding-left ◦ Values  Pixels (px)  Em (em) relative size

CSS Shorthand Setting Border, Margin, and Padding values can be simplified by using “shorthand” ◦ Set up to 4 values at once. ◦ Must perform in required order ◦ Use spaces in between to separate values

Border Shorthand Border ◦ Shorthand for border-width, border-style, border-color  In that order ◦ border:20px solid blue; ◦ There are other ways to use shorthands

Shorthand for Different Sides Border-style, border-color, border-width, Margin, Padding, can be specified for 4 different sides. ◦ Shorthand can be used to style up to 4 sides at once.  {margin: 50px 50px 5px 20px;}  {border-color: red green blue pink;}  {padding: 20px 10px;}

Shorthand for Different Sides (2) Different number of values style differently ◦ One value  Styles all sides ◦ Two values  First value: (Top and Bottom)  Second value: (Left and Right) ◦ Three values  First value: (Top)  Second value: (Left and Right)  Third value: (Bottom) ◦ Four values  Styles in order: Top, Right, Bottom, Left

Shorthands (3) Background shorthand: ◦ Order:  Background-color  Background-image  Background-repeat  Background-position ◦ Ex:  Background: #FF00FF url(something.jpg) no-repeat top right

Shorthands (4) Font shorthands  Font-style  Font-weight  Font-size  Line-height  Font-family ◦ Ex:  Font: italic bold.8em/1.2 Arial, sans-serif;

More on Float We used float to wrap phrasing content around images ◦ Float the image to a direction, text will flow to the opposite direction  Float (the image to the) right, text flows left ◦ If the image is large enough, other blocks will flow into the float!  We can use this to design pages.

Float (2) Consider floating something other than images! ◦ Floating other blocks of flow content ◦ Can use this to arrange parts of a page  Fixed layout  Liquid layout

Fixed Layout If you float two different blocks and let them line up together, they can be used to arrange different parts of your webpage. ◦ Specifically use absolute heights and widths ◦ Set sections in your page  Header, Section, Aside, Footer ◦ Have the total body width equal the section plus the aside (plus their borders)  See columntest.html

Fixed Layout (2) Float allows the elements to line up side by side. Clear stops other elements from floating into the space. ◦ clear  Stops a float from continuing past the element  Values: left, right, both

Liquid Layout Instead of using fixed widths, use relative widths (percentages of the page) to float with. ◦ See liquidlayouttest.html

CS 1 Server Accounts Linux Commands Importing a page ◦ SSH