1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)

Slides:



Advertisements
Similar presentations
LIS650 lecture 4 Thomas Krichel today CSS Properties –Box properties-- List properties –Table properties-- Classification properties –(Audio.
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.
方框的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.
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.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
Cascading Style Sheets Part 3 Fall, 2007 Modified by Linda Kenney Nov. 12, 2007.
Tutorial 3 Working with Cascading Style Sheets. XP Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external.
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.
Introduction to Web Site Development Steven Emory Department of Computer Science California State University, Los Angeles Lecture 6: Cascading Style Sheets.
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.
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.
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 
Lecture # 33 Cascade Style Sheets (CSS). Cascade Style Sheets (CSS): Preserving a consistent “look and feel” of a website across multiple pages.
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.
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.
Creating Your Own Webpage COSC Cascading Stylesheets Think of: HTML: content of your webpage HTML has tags CSS: presentation and appearance of your.
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.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets Part 3 Spring, 2008 Modified by Linda Kenney April 21, 2008.
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.
THE BOX MODEL Putting layouts together with CSS. The Box Model  How would you describe a box?  Container?  Tags or elements are “containers”  puts.
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.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
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.
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.
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
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,
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
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 Page layout Boriana Koleva Room: C54
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:

1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)

CSS Borders You can set following border properties of an element:  The border-color property is used to set the color of the border.  The border-style property is used to set the style of border.  The border-width property is used to set.  The border property is used to set the width, style and color of the border in one declaration.

border-style This is a border with none width. This is a solid border. This is a dashed border. Output: Possible values: none, solid, dashed, double, groove, ridge, inset, outset

border-color p.example1 { border-style: solid; border-bottom-color: #009900; border-top-color: #FF0000; border-left-color: #330000; border-right-color: #0000CC; } This example is showing all borders in different colors. Output: Possible values: any color with valid format

border-color p.example1 { border-style: solid; border-color: #FF0000; } This example is showing all borders in same color. Output: Possible values: any color with valid format

border-width This is a solid border whose width is 4px. Output: Possible values: length in px, pt or cm or it should be thin, medium or thick.

You can individually change the width of the bottom, top, left and right borders of an element. Using the following properties:  border-bottom-width changes the width of bottom border.  border-top-width changes the width of top border.  border-left-width changes the width of left border.  border-right-width changes the width of right border. 7

border-width p.example1 { border-style: solid; border-bottom-width: 6pt; border-top-width: 6pt; border-left-width: 4pt; border-right-width: 4pt; } This example is showing all borders in different widths. Output: Possible values: any color with valid format This example is showing all borders in different widths.

border This example is showing shorthand property for border. Output:

CSS Margins You can set following margin properties of an element:  The margin-bottom property specify the bottom margin of an element.  The margin-top property specify the top margin of an element.  The margin-left property specify the left margin of an element.  The margin-right property specify the right margin of an element.  The margin shorthand property for setting margin properties in one declaration.

margin This is a paragraph with a specified margin from all sides. Output: Possible values: auto, length in px, %.

margin-top This is a paragraph with a specified top margin. Output: Possible values: auto, length in px, %.

margin-bottom This is a paragraph with a specified bottom margin. Output: Possible values: auto, length in px, %.

margin-left This is a paragraph with a specified left margin. Output: Possible values: auto, length in px, %.

margin-right This is a paragraph with a specified right margin. Output: Possible values: auto, length in px, %.

16 Margin property p {margin: 15px; } all four margins will be 15px p {margin: 10px 2%; } top and bottom margin will be 10px, left and right will be 2% of the total width of doc. p {margin: 10px 2% -10px; } top margin will be 10px, left and right margin will be 2%, bottom margin will be -10px p {margin: 10px 2% -10px auto; } top margin will be 10px, right margin will be 2%, bottom margin will be -10px, left margin will be set by the browser

CSS Padding Padding property allows you to specify how much space should appear between the content of an element and its border :  The padding-bottom property specify the bottom padding of an element.  The padding-top property specify the top padding of an element.  The padding-left property specify the left padding of an element.  The padding-right property specify the right padding of an element.  The padding shorthand property serves as the preceding properties.

padding-bottom This is a paragraph with a specified bottom padding. Output: This is a paragraph with a specified bottom padding. Possible values: length in px, %.

padding-top This is a paragraph with a specified top padding. Output: This is a paragraph with a specified top padding. Possible values: length in px, %.

padding-left This is a paragraph with a specified left padding. Output: This is a paragraph with a specified top padding. Possible values: length in px, %.

padding-right This is a paragraph with a specified right padding. Output: This is a paragraph with a specified top padding. Possible values: length in px, %.

padding This is a paragraph with a specified right padding. Output: This is a paragraph with a specified top padding. Possible values: length in px, %.

Padding and Margin Properties Values for both the padding and the margin properties can be expressed using: em (em values) px (pixels) mm (millimeters) cm (centimeters) in (inches) % (percentage of the container element)

24 CSS display property You can control how an element is displayed with the display property. Example: img { display: block; } Possible values: block, inline, list-item, none

25 CSS float property The float property changes how text and or images within an element are displayed. Example: img { float: left; margin-right: 10px; } Possible values: left, right, none

26 Here is some text which wraps around the box floated to the left. Here is some text which wraps around the image floated to the left.

27 CSS clear property The clear property is used to force an element that is adjacent to a float element to start on the next line below the floated element. Example: #box3 { clear: both; background-color: white; border: 1px solid #000; } Possible values: left, right, both, none

28 div id=“box1”div id=“box2” div id=“box3”

29 CSS overflow property You can control what an elements contents will do if it overflows it boundaries with the overflow property. Example: div { overflow: auto; } Possible values: auto, hidden, visible, scroll

30