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.

Slides:



Advertisements
Similar presentations
Measurement Many CSS properties (values within the declaration) require that you specify a unit of measurement, such as spacing between elements, border.
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
CSS: Class 1 Background Images, Controlling Position of Background Images, Add Padding to Page Elements, Add Borders to Elements on a Page.
Working with Cascading Style Sheets
 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!
Cascading Style Sheets SP.772 May 6, CSS Useful for creating one unified look for an entire web site. Helps to seperate style from content. Can.
Cascading Style Sheets Part 3 Fall, 2007 Modified by Linda Kenney Nov. 12, 2007.
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.
MORE Cascading Style Sheets (The Positioning Model)
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
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.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
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:
WORKING WITH CASCADING
The Missing Manual MARGINS, PADDING, & BORDERS—CHAPTER 7.
1 Cascading Style Sheets (CSS) Part 2. 2 The Sources of Style Sheets.
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 
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 10: A Deeper Look at CCS- Spring 2011.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
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.
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.
Cascading Style Sheets Eugenia Fernandez IUPUI. CSS Purpose CSS allow you to specify the style in which your XML elements are displayed. CSS were originally.
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)
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.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
©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.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
CSS - Quiz #3 Lecture Code:
Coding with HTML {. THE BASICS { What is HTML and how can you use it to make websites?
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
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.
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.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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 Boxes
Cascading Style Sheets™ (CSS)
( Cascading style sheet )
CSS Applications to XML 19-Sep-18.
Second CSS Lecture Applications to XML
MORE Cascading Style Sheets (The Positioning Model)
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.
Cascading Style Sheets™ (CSS)
Presentation transcript:

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 (arranging elements on the page) XML contains no layout information, so by itself it will typically be displayed as one single huge blob of text When writing CSS for XML, typically the first thing you need to worry about is arranging text on the page No current browser does a good job of supporting CSS, particularly when used with XML, so: You should make sure everyone who views your pages uses the same version of the same browser (this is possible in some companies), or You should test your pages in all the most common browsers

3 The display property Every XML element that is formatted by a CSS command is considered to be in an invisible “box” The box containing an XML element can have one of three display properties: display: block The element will start on a new line, and so will the element that follows it (an HTML paragraph is an example) display: inline (default) The element will not start on a new line, or cause the next element to start on a new line (bold is an HTML example) display: none The element is hidden and will not appear on the display

4 CSS units For many of the remaining CSS values, we will need to be able to specify size measurements These are used to specify sizes: em width of the letter ‘ m ’ ex height of the letter ‘ x ’ px pixels (usually 72 per inch, but depends on monitor) % percent of inherited size These are also used to specify sizes, but don’t really make sense unless you know the screen resolution: in inches cm centimeters mm millimeters pt points ( 72pt = 1in ) pc picas ( 1pc = 12pt ) Note: you can use decimal fractions, such as 1.5cm

5 border (can be colored) Boxes The invisible box containing a styled XML element has three special areas: padding (invisible) margins (invisible) The element

6 Padding Padding is the extra space around an element, but inside the border To set the padding, use any or all of: padding-top: size padding-bottom: size padding-left: size padding-right: size padding: sizeto set all four sides at once size is given in the units described earlier Example: sidebar {padding: 1em; padding-bottom: 5mm}

7 Borders You can set border attributes with any or all of: border-top:, border-bottom:, border-left:, border-right:, and border: (all at once) The attributes are: The thickness of the border: thin, medium (default), thick, or a specific size (like 3px ) The style of the border: none, dotted, dashed, solid, double, groove, ridge, inset, or outset The color of the border: one of the 16 predefined color names, or a hex value with # rrggbb or rgb( r, g, b ) or rgb( r %, g %, b %) Example: section {border-top: thin solid blue;} Note: the special styles (such as groove ) are not as cool as they sound

8 Margins Margins are the extra space outside the border Setting margins is analogous to setting padding To set the margins, use any or all of: margin-top: size margin-bottom: size margin-left: size margin-right: size margin: sizeto set all four sides at once

9 Box and display interactions With display:none, contents are invisible and margin, border, and padding settings have no effect With display:block, margin, border, and padding settings work about as you would expect With display:inline (which is the default if you don’t specify otherwise): Margin, border, and padding settings for left and right work about as you would expect Margin, border, and padding settings for top and bottom do not add extra space above and below the line containing the element This means that inline boxes will overlap other text

10 Sizing elements Every element has a size and a natural position in which it would be displayed You can set the height and width of display:block elements with: height: size width: size You cannot set the height and width of inline elements (but you can set left and right margins) In HTML, you can set the height and width of images and tables ( img and table tags)

11 Setting absolute position To move an element to an absolute position on the page position: absolute (this is required!) and also one or more of left: size or right: size top: size or bottom: size Confusing stuff: size can be positive or negative top: size puts an element’s top size units from the page top bottom: size puts an element’s bottom size units from the page bottom left: size puts an element’s left side size units from the left edge of the page right: size puts an element’s right side size units from the right edge of the page Changing an element’s absolute position removes it from the natural flow, so other elements fill in the gap You need to be careful not to overlap other elements position:absolute; left: 0in; top: 0inposition:absolute; right: 0in; top: 0in position:absolute; left: 0in; bottom: 0inposition:absolute; right: 0in; bottom: 0in

12 Setting relative position To move an element relative to its natural position, use position: relative (this is required!) and also one or more of left: size or right: size top: size or bottom: size Confusing stuff: size can be positive or negative to move left, make left negative or right positive to move right, make right negative or left positive to move up, make top negative or bottom positive to move down, make bottom negative or top positive Setting an element’s position does not affect the position of other elements, so There will be a gap in the element’s original, natural position Unless you are very careful, your element will overlap other elements

13 Pseudo-elements Pseudo-elements describe “elements” that are not actually between tags in the XML document Syntax: element : pseudo-class {...} first-letter the first character in a block-level element first-line the first line in a block-level element (depends on the browser’s current window size) Especially useful for XML (but not implemented in Internet Explorer): before adds material before an element Example: author:before {content: "by "} after adds material after an element

14 External style sheets In HTML, within the element: As a PI in the prologue of an XML document: Note: "text/css" is the MIME type

15 Namespace selectors Namespace selectors (XML only) choose tags from the given namespace namespace | element {...} chooses the element if and only if it is from the given namespace *| element {...} chooses the element regardless of the namespace | element {...} chooses the element if it has no declared namespace  Namespace selectors are currently supported only by Netscape 6

16 Some border styles and values You can put borders around elements Borders have width, style, and color These can be set individually: border-left-style:, border-bottom-color:, etc. Or a border at a time: border-top:, border-right:, etc. Or all borders at once: border: Available values are: border-width: thin | medium | thick | length border-style: none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset border-color: color

17 The End