CSS: Class 1 Background Images, Controlling Position of Background Images, Add Padding to Page Elements, Add Borders to Elements on a Page.

Slides:



Advertisements
Similar presentations
CSS. Intro to CSS Cascading Style Sheets – styles and enhances appearance of webpage.css extension.
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.
CSS provides a way to stray away from the traditional methods of using tables to lay out pages. Success with this technique depends on understanding of.
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.
 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.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
Cascading Style Sheets Part 3 Fall, 2007 Modified by Linda Kenney Nov. 12, 2007.
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.
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
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.
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:
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.
CSS Border.
Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border 
Adding Graphics to Web Pages. CSS does not have any properties specifically aimed at formatting images Use properties you have already learned, i.e.,
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 10: A Deeper Look at CCS- Spring 2011.
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.
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.
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.
>> 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.
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
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring 2016 CSS Positioning 1.
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 Table Styling. Up to this point, as we haven't applied any CSS styling to our tables, our example tables have not been too pleasing to the eye. CSS.
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,
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
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,
CSS. What does it stand for? ___________________.
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 Boxes CS 1150 Fall 2016.
CSS Applications to XML 20-May-19.
CSS Applications to XML 3-Jul-19.
Presentation transcript:

CSS: Class 1 Background Images, Controlling Position of Background Images, Add Padding to Page Elements, Add Borders to Elements on a Page

Add Background Images Looks like this (put after CSS statement): body { –Background-image: url(“images/ et/~cherie1/Class/smbkgnd.jpg”);| }

Background Image

To Make the Image Repeat –background-image: url(“images/ et/~cherie1/Class/smbkgnd.jpg”);| –background-repeat: repeat-x;| –}

Example of Repeat Image

Repeat Image & Readability

Controlling the Position of the Background Image Use the background-position property to control where the image appears within an element

Prevent Background Image from Scrolling background-attachment

How to Control Position of Image Default position of background- position is top-left corner of element Control by providing positions to this property

Control by: Percentages Pixels Mixing

Choices: Use pair of percentages to reference a relative distance from the top-left corner Example: –background-position: 50% 50%; centers the image within the element.

More Choices: Specific-length measurement: background-position:25px 50px; The above positions the top-left corner of the image 25 pixels from the left edge of the element and 50 pixels from the top edge

Mixing Percentage & Pixels background-position: 25px 100% This positions the image 25 px from the left edge of the element and at the bottom of the element

CSS Keywords top left right bottom Center Example: background-position:right

Background Shorthand Property Use when applying background color & image. It also sets repeat, position, and attachment

Looks Like This: body { background:#fff url(images/smbkgnd.jpg) no-repeat bottom right;| }

Add Padding to Elements of a Page Looks like this: padding-top padding-bottom padding-right padding-left Values usually set in pixels or percent

Context Every block level element exists within box that is made up of 4 key sections: – content (the element’s inner html) – padding (between content and border) – borders (outer edge) – margins (distance from border to neighboring elements)

Content, padding, borders, margin

Definitions Content: what’s in the element (text) Padding: what surrounds the text next to the box. What is between the content section and the border Elements are either block or inline: Block (paragraphs). Occupies own space on page Inline. Exists within a larger block of text. Does not need to define own space. Note: other terms used are “float” and “table” for “block” and “inline”

For additional experimentation: See this link: block/

Adding Borders

Borders Looks like this: border-bottom-color: #5e7630; border-bottom-style: solid; border-bottom-width: 2px;

About Borders Invisible by default Interesting visual effects can be achieved The border defines the interior area of the box Background colors fill to the outer edge of the border Background images positioned relative to it

CSS Borders have 3 Properties 1.Border color border-color 2.Border width border-width 3.Border style border-style

CSS Borders have 3 Properties Border color border-color Any valid color value Border width border-width Any valid unit (usually “px”) Border style border-style Set by keywords: Dotted, dashed, double, groove, inset, outset, ridge, solid

CSS Border Styles When using a color with a dotted or dashed line, the background color will show through as it fills to the outside edge of the border Styles that contain shading ( groove, inset, outset ) use browser-determined shades of border color Distance between lines in double style is determined by browser

Removing the Border none and hidden Renders the same way With tables, hidden causes cells to collapse into one another, eliminating the default cellspacing. None does not do this.

Miscellaneous Each side of box can have the border set individually Example (top border): border-top-color, border-top- style, and border-top-width