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} //

Slides:



Advertisements
Similar presentations
LIS901N: Style sheet Thomas Krichel Style sheets Style sheets are the officially sanctioned way to add style to your document We will cover.
Advertisements

Tutorial 3: Designing a Web Page with CSS
Chapter 3 © 2003 by Addison-Wesley, Inc Introduction - HTML is primarily concerned with content, rather than style - However, tags have presentation.
Web Engineering 1 Ishaq Khan Shinwari MCS City University Peshawar.
/k/k 1212 Cascading Style Sheets Part one Marko Boon
CSS Digital Media: Communication and design 2007.
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.
Links.  Styling Links  Links can be styled with any CSS property (e.g. color, font-family, background-color).  Special for links are that they can.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
CSS Link Styling. The Anchor Element: Link text between the opening and closing can be styled using CSS. Some of the properties that can be set are: font-family,
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.
Client-Side Internet and Web Programming
Cascading Style Sheet CSS CS1520 Ali Alanjawi. 2 TA Information Ali Alanjawi Homepage: Office:
CSS(Cascading Style Sheets )
กระบวนวิชา 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.
Measurement Many CSS properties (values within the declaration) require that you specify a unit of measurement, such as spacing between elements, border.
© 2010, Robert K. Moniot Chapter 5 CSS : Cascading Style Sheets 1.
CSS Cascading Style Sheets Brief Introduction
Dr. Ahmet Cengizhan Dirican BIL 374 Internet Technologies 3. CSS.
CSS Properties on Parade PropertyValid valuesExample font-familylist of fonts (separate with commas, end with generic font: serif, sans-serif, fantasy,
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
1Computer Sciences Department. And use
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
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.
CSS Cascading Style Sheets *referenced from
Tutorial 3 Designing a Web Page with CSS
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
CSS Details Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  To use CSS properties for fonts  Evaluate whether to use pts,
Internet & World Wide Web How to Program, 5/e 1. 2.
Cascading Style Sheets (Formatting)
WebD Introduction to CSS By Manik Rastogi.
Cascading Style Sheets
3.1 Introduction - HTML is primarily concerned with content, rather
HTML WITH CSS.
CS3220 Web and Internet Programming CSS Basics
Cascading Style Sheets Color and Font Properties
The Internet 10/11/11 Fonts and Colors
CSS Layouts CH 13.
CSS: Cascading Style Sheets
Cascading Style Sheets™ (CSS)
HTML WITH CSS.
Creating Your Own Webpage
Introducing :CSS Cascading Style Sheets in 5 Lessons.
3.1 Introduction - The CSS1 specification was developed in 1996
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Text Size and typeface of text Bold, italics, capitals, underlines
Cascading Style Sheets (Formatting)
3.5 Property Value Forms - There are 60 different properties in 7 categories: - Fonts - Lists - Alignment of text - Margins - Colors - Backgrounds - Borders.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
CSS – Properties & Values
The Internet 10/13/11 The Box Model
Formatting Text with HTML and CSS
CSS Style Sheets: Intro
Cascading Style Sheets Color and Font Properties
3.1 Introduction - The CSS1 specification was developed in 1996
CS3220 Web and Internet Programming CSS Basics
CSS Styles Fonts and Colors.
CS3220 Web and Internet Programming CSS Basics
Cascading Style sheet. What is CSS?  CSS stands for Cascading Style Sheets  Cascading: refers to the procedure that determines which style will apply.
Lesson 5 Topic B – Basic Text & Fonts
Cascading Style Sheets
Introduction to Cascading Style Sheets (CSS)
Cascading Style Sheets
Cascading Style Sheets™ (CSS)
Cascading Style Sheets
Presentation transcript:

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} // center, left, justify h4 {text-decoration: overline} // line-through, underline, blink, none h5 {text-indent: 5cm} // 30px h6 {text-transform: uppercase} // lowercase, capitalize text-indent property indents the first line of text in the element by the specified amount text-decoration property applies decorations to text in an element

Text Together – example p {color: green; letter-spacing: 0.5cm; text-align: left; text-decoration: underline; text-indent: 2cm; text-transform: uppercase; } This is head

CSS Font

Font-style The font-style property is mostly used to specify italic text. This property has three values: normal italic oblique p {font-style: normal} // italic, oblique

Font-weight font-weight property specifies the “boldness” of text. Possible values are: bold normal (the default) bolder (bolder than bold text) lighter (lighter than normal text) Boldness also can be specified with multiples of 100, from 100 to 900 (e.g., 100, 200, …, 900). Text specified as normal is equivalent to 400, and bold text is equivalent to 700 p {font-weight: lighter} // bold, normal, 900

Font-family font-family property is used to specify the font that should be displayed The font-family property can hold several font names. If the browser does not support the first font, it tries the next font and so on. Separate the different font names with a comma. If a font name contains white-space, it must be placed in quotes. p {font-family: times, arial, “sans serif”}

Font-size font-size property specifies the size used to render the font Relative length measurements: px (pixels – size varies depending on screen resolution) em (usually the height of a font’s uppercase M) ex (usually the height of a font’s lowercase x) Percentages (of the font’s default size) Absolute-length measurements (units that do not vary in size): in (inches) cm (centimeters) mm (millimeters) pt (points; 1 pt = 1/72 in) pc (picas; 1 pc = 12 pt) p {font-size: 100%} // 80%, 120%, 12px

Font Together – example p{font: italic bold 30px consolas;} //style, weight, size, family This is head

Links (anchor)

Styling Links Links can be styled with any CSS property (e.g. color, font- family, background, etc.). links can also be styled differently depending on what state they are in. Links have four pseudoclasses representing the different states: a:link - a normal, unvisited link a:visited - a link the user has visited a:hover - a link when the user moves the mouse over it a:active - a link the moment it is clicked

CSS Syntax for anchor a:link {color:green} a:visited {color:red} a:hover {color:orange} a:active {color:blue} When setting the style for several link states, there are some order rules: 1.a:hover MUST come after a:link and a:visited 2.a:active MUST come after a:hover

CSS Syntax for anchor - Example a:link {color:green} a:visited {color:red} a:hover {color:orange} a:active {color:blue} This is a link

Anchor Styles Other common ways to style links is through using text decoration a:link {text-decoration:none} a:visited {text-decoration:none} a:hover {text-decoration:underline} a:active {text-decoration:underline} This is a link

Anchor Styles The background-color property specifies the background color for links. a:link {background-color:#B2FF99} a:visited {background-color:#FFFF85} a:hover {background-color:#FF704D} a:active {background-color:#FF704D} This is a link

CSS comments A CSS comment begins with "/*", and ends with "*/", like this: /* This is a comment */ p { text-align: center; /* This is another comment */ color: black; font-family: arial }

CSS Lists

Lists The CSS list properties allow you to: Set different list item markers for ordered lists Set different list item markers for unordered lists Set an image as the list item marker

Unordered Lists ul.a {list-style-type:circle;} ul.b {list-style-type:square;} ul.c {list-style-type:disc;} Example of unordered lists: Coffee Tea Coffee Tea Coffee Tea Example of unordered lists: o Coffee o Tea  Coffee  Tea Coffee Tea

Ordered Lists ol.d {list-style-type:upper-roman;} ol.e {list-style-type:lower-alpha;} ol.f {list-style-type:decimal;} Example of ordered lists: Coffee Tea Coffee Tea Coffee Tea Example of Ordered lists: I.Coffee II.Tea a.Coffee b.Tea 1.Coffee 2.Tea

List – image markers To specify an image as the list item marker, use the list- style-image property ul{list-style-image:url('sqpurple.gif')} Coffee Tea Coca Cola