CSS properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.

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

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.
Session Objectives Setting the font family Setting the font size Working with Web fonts Setting font faces and sizes Setting font and text appearances.
Cascading Style Sheets (Formatting. Slide 2 Lecture Overview At this point, you have learned how and where to create styles You have not learned much.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
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.
Week 7 Web Typography. 2 Understanding Type Design Principles.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts 1.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
+ Text & Font Styles Unit 3 Lesson Different Font Categories Sans Serif – block style fonts Example - Rockwell Easy to read and good to use when.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
Tables in HTML Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
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.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
Cascading Style Sheets Billy Toy Cascading Style Sheets Syntax review How to Implement style sheets Background properties Text properties.
CSS Dvijesh Bhatt.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 09: Cascade Style Sheets - Spring 2011.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Page Layout Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
Cascading Style Sheet (CSS)
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Cascading Style Sheets, pt 2 ECA 225 Applied Online Programming.
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
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Adding Image, audio and video files to web pages Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
Cascading Style Sheets Chapter Four. What are they? A set of style rules that tell the web browser how to present a web page or document. Cascading Style.
Class three: CSS review, backgrounds, font formatting, the box model.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Introduction to HTML 1 Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
MySQL and PHP Review CSS. Cascading Style Sheet (CSS) Style sheets are files or forms that describe the layout and appearance of a document. Cascading.
Introduction to Cascading Style-sheets (CSS) Basharat Mahm ood, Department of Computer Science, CIIT,Islamabad, Pakistan 1.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
Creating Your Own Webpage COSC Cascading Stylesheets Think of: HTML: content of your webpage HTML has tags CSS: presentation and appearance of your.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
3. Cascading Style Sheets (CSS) M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer.
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.
1 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
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.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
CSS – Cascading Style Sheets
Cascading Style Sheets Web Design Fairport High School.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
JavaScript and CSS
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
Creating Layouts with CSS. Span tag Here is some underlined text. Here is some blinking text. Here's some bold text.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Tutorial 3 Designing a Web Page with CSS
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
Formatting Text with HTML and CSS. Summary block-level elements. Character-level elements Logical and physical style Special elements: hr,address, quotation.
CIS 4004: Web Based IT (CSS) Page 1 © Dr. Mark Llewellyn CIS 4004: Web Based Information Technology Fall 2012 Cascading Style Sheets (CSS) Department of.
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.
LEARNING CSS Techieweb Solutions Techieweb solutions.
Cascading Style Sheets Robin Burke ECT 270. Outline CSS properties Fonts Alignment Color CSS selection selectors.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Presentation transcript:

CSS properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1

Summary of the previous lecture CSS basics CSS writing option CSS rules Id,s and Classes Basharat Mahm ood, Department of Computer Science, CIIT,Islamabad, Pakistan 2

Outline Font properties Controlling text with CSS Styling links Styling background Styling tables Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 3

1. CSS properties CSS works by allowing you to associate rules with the elements that appear in a web page These rules govern how the content of those elements should be rendered Basharat Mahm ood, Department of Computer Science, CIIT,Islamabad, Pakistan 4

1. CSS properties… A rule consists of – A selector: element or elements the declaration applies to – Declaration: how the elements referred to in the selector should be styled property: which is the property of the selected element value: which is a specification for this property Basharat Mahm ood, Department of Computer Science, CIIT,Islamabad, Pakistan 5

1. CSS properties… To control the presentation of an element, you need to know the corresponding properties Properties with related functionalities are grouped together – Example: Properties to control the presentation of text Basharat Mahm ood, Department of Computer Science, CIIT,Islamabad, Pakistan 6

2. Font properties Several properties allow you to control the appearance of text in your documents These properties directly affect the font and its appearance Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 7

2. Font properties… Common font properties: – font-family – font-size – font-weight – font-style – font-variant Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 8

2. Font properties… font-family: – Specifies the typeface or family of font that should be used Common values: – Arial, Courier/Courier New, Georgia, Times/Times New Roman and Verdana Example: – H1{font-family:arial} Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 9

2. Font properties… font-size: – Specifies the size of a font Common values: – In pixels (12px,20px etc.) – Absolut size (small, medium, lage, x-large etc.) Example: – H1{font-size:20px} Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 10

2. Font properties… font-weight: – Specifies whether the font should be bold or normal Common values: – Normal, bold, bolder, lighter – 100, 200, 300, 400, 500, 600, 700, 800, 900 – Example: – H1{font-weight:bold} Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 11

2. Font properties… font-style: – Specifies whether the font should be normal, italic or oblique Common values: – Normal, italic, oblique – Example: – H1{font-style:italic} Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 12

2. Font properties… font-variant: – Specifies whether the font should be normal or small-caps (smaller version of upper case) Common values: – Normal, small-caps – Example: – H1{font-variant:small-caps} Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 13

2. Font properties… Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 14 selector Font properties End of CSS rule

2. Font properties… Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 15 Including stylesheet Using h1 tag

2. Font properties… Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 16

3. Text properties color text-align vertical-align text-decoration text-transform word-spacing letter-spacing Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 17

3. Text properties color: – specifies the color of the text – P{color : green} text-align: – horizontal alignment of the text – Left, right, center or justify vertical-align: – Vertical alignment of the text – Sub, super, top, middle, bottom Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 18

3. Text properties text-decoration: – specifies the whether the text should be underline, overline, line-through or blinking text-transform: – text should be lowercase, uppercase or capitalized letter-spacing: – Specifies the space between letters – H1{letter-spacing:3px} Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 19

3. Text properties word-spacing: – Specifies the space between words – H1{word-spacing:4px} Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 20

3. Text properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 21 Basic properties Class declaration Class properties Second class properties

3. Text properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 22 Title class Horizontal line Bodytext class

3. Text properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 23

3. Styling Links color : – Changes the color of the links background-color : – Highlights the link, as if it had been highlighted with a highlighter pen text-decoration : – Underline, strike through, over-line, blink Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 24

3. Styling links… Pseudo-classes of links: Link: – Styles for links in general Visited: – Styles the links which are already visited Hover: – Styles when some on hovering over a link Active: – Styles the links when a links is being clicked Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 25

3. Styling links… Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 26 a tag style Link settings Visited settings Hover settings

3. Styling links… Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 27 Link added

4. Styling Background background-color: – Specifies the background color background-image: – Specifies the background image background-repeat: – Specifies whether the image should repeat or not background-position: – Where an image should be positioned Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 28

4. Styling Background… Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 29

4. Styling Background… Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 30

5. Styling tables text and font vertical – align width height background - color background - image Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 31

5. Styling tables border : border-style (solid, dashed, doted, double etc.) border-color border-bottom (solid, dashed, doted, double etc.) padding Padding-left Padding-right Padding-top padding-bottom Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 32

5. Styling tables… Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 33 Table settings Th settings Td settings Tr settings

5. Styling tables… Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 34

Summary Font properties Controlling text with CSS Styling links Styling background Styling tables Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 35

Chapter 7,8. Beginning HTML, XHTML,CSS, and JavaScript, by Jon Duckett, Wiley Publishing; 2009, ISBN: Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan. References