Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 4 Formatting Text and Links.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
Advertisements

© 2004, Robert K. Moniot Chapter 6 CSS : Cascading Style Sheets.
SM5312 week 11: CSS Menus & Navigation Bars1 An Introduction to Cascading Style Sheets CSS Menus and Navigation Bars Nick Foxall.
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Part 3 Introduction to CSS. CSS Text Text Styles h1 {color: green} // rgb(0,255,0), #00ff00 h2{letter-spacing: 0.5cm} // 2px h3 {text-align: right} //
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Tutorial 3 Introducing Cascading Style Sheets. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Learn about Cascading Style Sheets Write.
Tutorial 4 Formatting Text. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Create a spread heading Indent text Change the line spacing.
Cascading Style Sheets 1. About Lists HTML list code ul, ol, dldl CSS list-item style properties
Chapter 9. Links  When styling a link, you must tell CSS both what you want to style, and when you want the style to happen  Web browsers keep track.
Page Layout & Mobile Web Using columns, grid systems, etc… to layout sites for desktops and mobile.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Cascading Style Sheets Example
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.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
WDV 101 Intro to Website Development
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Syntax & Semantics Instructor: Joseph DiVerdi,
Doman’s Sections Information in this presentation includes text and images from
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit E Formatting with Cascading Style Sheets.
Website Development & Management Working with Style Rules Instructor: John Seydel, Ph.D. CIT Fall
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
CSS-Lists CSS provides special properties that are designed for lists. It is usually more convenient to use these properties whenever you can. To specify.
Doncho Minkov Telerik Web Design Course html5course.telerik.com Technical Trainer
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.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
INTRODUCTORY Tutorial 4 Exploring Graphic Elements and Images.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
CSS Class 2 -Add margins to elements on a page. -Set width and height of elements. - CSS shorthand properties for box model. -Style links. -Style tables.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
Principles of Web Design 6 th Edition Chapter 9 – Site Navigation.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Tutorial 3 Adding and Formatting Text with CSS Styles.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
Web Development & Design Foundations with HTML5 7th Edition
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
CSS Fun damentals The Document Hierarchy Element Relationships The Box Model.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
IS1825 Multimedia Development for Internet Applications Lecture 12: IDs, Classes and Internal CSS Rob Gleasure
Microsoft Expression Web 3 – Illustrated Unit G: Designing Site Navigation.
CSS: Cascading Style Sheets Part II. Style Syntax.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 15: Lists.
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,
Tutorial 3 Designing a Web Page with CSS
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
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.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
NAVIGATION USING HTML TO SET UP THE BASIC STRUCTURE OF A NAV BAR.
1 Cascading Style Sheets
WebD Introduction to CSS By Manik Rastogi.
Cascading Style Sheet List Properties Box Properties Pseudoclass
Cascading Style Sheets
Cascading Style Sheets (Layout)
Chapter 7 Page Layout Basics Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with HTML5
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Cascading Style Sheet List Properties Box Properties Pseudoclass
Basics of Web Design Chapter 7 Page Layout Basics Key Concepts
CSS Borders and Margins.
Web Development & Design Foundations with HTML5
Web Development & Design Foundations with HTML5
Presentation transcript:

Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 4 Formatting Text and Links

XP Objectives 4.1 Specify the vertical alignment of an element Define list styles Implement grouped selectors Incorporate descendant selectors Style a list as a navigation bar 2New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Objectives 4.2 Work with dependent and independent classes Set an image as a list marker Create dynamic pseudo-classes 3New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Using the vertical-align Property Use the vertical-align property to position images and other elements vertically with text. The property has several possible values: – top – The top of the image is aligned with the text. – middle – The image is aligned vertically centered with the text. – bottom – The bottom of the image is aligned with the text. 4New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP 5New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition Using the vertical-align Property

XP 6New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition Using the vertical-align Property

XP The vertical-align Property Values 7New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Changing the Appearance of Lists Lists can be enhanced by graphics and images. The following properties can be used: – list-style-type: stylevalue; – list-style-position: positionvalue; – list-style-image: url(imagename); – Shorthand property: list-style: stylevalue url(imagename) positionvalue; 8New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Using the list-style-type Property Use the list-style-type property to change the appearance of the default solid bullet for unordered lists. There are four list-style-type values for unordered lists: – disc – a filled circle (the default) – circle – a hollow circle – square – a filled square – none – no bullet is shown ul { list-style-type: value; } 9New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP There are the following list-style-type values for ordered lists: – decimal – decimal-leading-zero – lower-roman – upper-roman – lower-alpha – upper-alpha – none ol { list-style-type: value; } 10New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition Using the list-style-type Property

XP 11New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition Using the list-style-type Property

XP Using the list-style-position Property Use the list-style-position property to change the position of the marker or bullet included with a list. There are two list-style-position values: – inside – outside 12New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Using Groups of Selectors Grouped selectors are selectors that share a common set of declarations and that are grouped into a comma-separated list. 13New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Using Descendant Selectors A descendant selector is a selector nested within another selector. A space is used, without a comma, to indicate descendant selectors. A comma is used between selectors when the style applies to all selectors in the group. 14New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition strong em { color: maroon; }

XP Using Descendant Selectors 15New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Styling a List of Hyperlinks The nav element identifies a block of navigation links. 16New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Styling a List of Hyperlinks 17New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP CSS Inheritance CSS inheritance is a method whereby a child element inherits characteristics from its parent element. The nav element is a parent of the ul element, and the ul element is a parent of the li element. 18New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP CSS Class Selector A class selector is a name preceded by a period. This name can then be applied to any HTML element. Class selectors can format one or more instances of an element. A class must be applied to the start tag of one or more elements on a Web page. Classes can be dependent or independent. 19New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Dependent Class A dependent class styles a particular element. Code syntax: selector.dependentclass { property1: value; property2: value; } selector – the name of the element dependentclass – the name of the dependent class To apply the dependent class to an element: 20New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Rules for Class Names A class name can contain only alphabetic or numeric characters. A class name must be one word (no spaces). A class name should describe the purpose of the class. A class name should not begin with a number because not all browsers will recognize it. 21New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Dependent Selector Code 22New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition Code to apply the attention class: Your name and contact information

XP Independent Class An independent class styles any element. Code syntax: selector.independentclass { property1: value; property2: value; } selector – the name of the element independentclass – the name of the dependent class To apply an independent class to any element: 23New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Independent Selector Code 24New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition Code to apply the center class:

XP Using the list-style-image Property Use the list-style-image property to specify a graphic image instead of a bullet marker for a list. Use a very small image for a bullet marker. Code example: ul { list-style-image: url(star.gif); } url points to the image used as a bullet marker. 25New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Using the span Element The span element is a generic element that does not have any specific meaning, but it allows you to mark inline content. span element syntax: content 26New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Pseudo-Class Selectors A pseudo-class is a class that exists in CSS but is not directly defined in HTML. Pseudo-classes associated with the anchor element are used to achieve the mouse-over effect. Link color defines the link state, which is whether a hyperlink has been clicked or not. 27New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP The Anchor Pseudo-Class Selectors Using the anchor pseudo-class selectors, hyperlinks can be styled, based on the following four states: – a:link is the selector for normal links. – a:visited is the selector for visited links. – a:hover is the selector for the hover state (when the mouse pointer passes over the link). – a:active is the selector for active links (when a user holds down the mouse button to click a link). Note that the colon does not have spaces before and after it. 28New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP The Anchor Pseudo-Class Selectors 29New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition +

XP Setting Margins The following properties are used to set margins: – margin-top – margin-right – margin-bottom – margin-left Order is irrelevant. 30New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition

XP Setting Margins 31 New Perspectives on Blended HTML and CSS Fundamentals, 3 rd Edition