CSS Presentation CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity Svetlin Nakov Technical Trainer Software University

Slides:



Advertisements
Similar presentations
1 Dynamic HTML: Cascading Style Sheets™ (CSS). 2 Introduction Cascading Style Sheets (CSS) –Specify the style of your page elements –Spacing, margins,
Advertisements

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.
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.
CSS Color & Text Cascading Style Sheets. Advantages of CSS Typography and page layout can be better controlled Style is separate from structure Documents.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
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!
Web Design & Development Cascading Style Sheets (CSS)
1 Cascading Style Sheets C S S. 2 What is CSS? A simple mechanism for controlling the style of a Web document without compromising its structure. It allows.
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.
Web Design – Sec 4-6 and 4-7 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
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.
CSS Dvijesh Bhatt.
CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 09: Cascade Style Sheets - Spring 2011.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Principles of Web Design 6 th Edition Chapter 5 – Web Typography.
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:
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.
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 CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
CHAPTER 3 CSS & CSS3 อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
COMP213 – Web Interface Design
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.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Creating Your Own Webpage COSC Cascading Stylesheets Think of: HTML: content of your webpage HTML has tags CSS: presentation and appearance of your.
CSS Layout Arrangement and Positioning of the HTML Elements Svetlin Nakov Technical Trainer Software University
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
SASS & LESS Syntactically Awesome StyleSheets Dynamic StyleSheet Language Svetlin Nakov Technical Trainer Software University
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
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.
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.
Jekyll Static Site Generator Template-Based Site Generation Svetlin Nakov Technical Trainer Software University
Responsive Design Design that Adapts to Different Devices SoftUni Team Technical Trainers Software University
CSS – Cascading Style Sheets
Cascading Style Sheets Web Design Fairport High School.
CSS properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
CSS Transitions and Animations Animated HTML Elements SoftUni Team Technical Trainers Software University
Tutorial 4 Creating Page Layouts with CSS
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
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.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Font-Family, Color and Background. Basics  CSS rule: Selector (multiple separated by, ) Declaration (multiple separated by ; ) Example: p { color: red;
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,
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS 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.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
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)
CSS Details Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  To use CSS properties for fonts  Evaluate whether to use pts,
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
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.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
CSS.
The Internet 10/13/11 The Box Model
Presentation transcript:

CSS Presentation CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity Svetlin Nakov Technical Trainer Software University

2  Text-Related Properties  Fonts, Colors, Text Overflow  Borders  Backgrounds  Background color  Background image  Gradient Background  Opacity Table of Contents background: url('lines.png'); color: #2aa0bd; opacity: 0.75; line-height: 50px; font-family: Arial; text-indent: 50px; color: green; letter-spacing: 10px; letter-spacing: 2px; border: 0;

Text-Related CSS Properties

4  color – specifies the color of the text, e.g. #A5E733  font-size – size of font: xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger or numeric value  font-family – comma separated font names  Example: "Times New Roman", Verdana, sans-serif, etc.  The browser loads the first one that is available  There should always be at least one generic font, e.g. " sans-serif “, “serif”, “cursive”, “fantasy”, “monospace”  font-weight – can be normal, bold, bolder, lighter or a number in range [ 100 … 900 ] CSS Rules for Fonts and Paragraphs

5  font-style – styles the font ( normal, italic, oblique )  text-decoration – decorates the text  Values: none, underline, line-trough, overline, blink  text-align – defines the alignment of text or other content  Values: left, right, center, justify  line-height – defines the height of the font, e.g. 20px  text-indent – indents the start of the paragraph  letter-spacing, word-spacing  text-transform – uppercase, lowercase, capitalize CSS Rules for Fonts and Paragraphs (2)

6  font  Shorthand rule for setting multiple font properties is equal to writing this: Shorthand Font Property font: italic normal bold 12px/16px verdana font-style: italic; font-variant: normal; font-weight: bold; font-size: 12px; line-height: 16px; font-family: verdana;

7  What it actually does?  vertical-align only applies to inline or inline-block elements  Affects the alignment of the element itself, not its contents  For table cells, the alignment affects the cell contents, not the cell  What it does NOT do?  All the elements inside the vertically aligned element change their vertical position   Vertical Align

Text-Related Properties Live Demo

9  to declare external fonts  Call font with font-family  Use font embedding instead of images  Supported font formats:  TTF, OTF, WOFF Font { font-family: SketchRockwell; font-family: SketchRockwell; src: url('SketchRockwell-Bold.ttf'); src: url('SketchRockwell-Bold.ttf');} body { font-family: SketchRockwell; font-family: SketchRockwell; font-size: 3.2em; font-size: 3.2em;}

10  The text-shadow property applies a shadow to the text  Does not alter the size of a box Text Shadow text-shadow: 2px 2px 7px #000000; text-shadow: ;

11  Specifies what should happen when text overflows the containing element  ellipsis – displays ellipses (…) to represent the clipped text  clip – default value, clips the text Text Overflow text-overflow: ellipsis; text-overflow: clip;

12  Allows long words to be broken and wrap onto the next line  Possible values:  Supported in all major browsers Word Wrapping word-wrap: normal; word-wrap: break-word;

More Fonts Live Demo

Borders

15  border-width : thin, medium, thick, numeric (e.g. 10px )  border-color : color alias or RGB value, e.g. #AAFFEE  border-style : none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset  Can be defined separately for left, top, bottom and right  border-top-style, border-left-color, border-bottom-color, border-right-color Borders

16  border : shorthand rule for setting border properties at once: is equal to writing:  Specify different borders for the sides via shorthand rules:  border-top, border-left, border-right, border-bottom  Skip the border: border:none or border:0 Border Shorthand Property border: 1px solid red; border-width: 1px; border-color: red; border-style: solid;

Borders Live Demo

18  Allows to easily implement multiple drop shadows (outer or inner) on box elements  Specifying values for offset, size, blur and color  Example: Box Shadow box-shadow: 10px 10px 5px #888;

 Rounded corners are a part of CSS 3  Supported in all major browsers  Done by the border-radius property  Three ways to define corner radius: Rounded Corners border-radius: [ | ][ | ]? border-radius: 15px; border-radius: 15px 20px; border-radius: 15px 15px 15px 10px;

Other Border Styles Live Demo

Background Properties

22  background-image  URL of image to be used as background, e.g.:  background-color  E.g. #6DB3F2  background-repeat  repeat-x, repeat-y, repeat, no-repeat  background-attachment  fixed / scroll – background scrolls with the text / stays fixed Backgrounds background-image: url('background.gif');

23  background-position : specifies vertical and horizontal position of the background image  Vertical position: top, center, bottom  Horizontal position: left, center, right  Both can be specified in percentage or other numerical values  Examples: Backgrounds (2) background-position: top left; background-position: -5px 50%;

24  background : shorthand for setting all background properties: is equal to writing:  Some browsers will not apply BOTH color and image for background if using the shorthand rule Background Shorthand Property background: #FFF0C0 url("back.gif") no-repeat fixed top; background-color: #FFF0C0; background-image: url("back.gif"); background-repeat: no-repeat; background-attachment: fixed; background-position: top;

25  Background images allow moving images out from the HTML  Leads to less code  More content-oriented approach  Images to move to the CSS  All images that are not part of the page content  Images used only for "beautification"  Images to leave in the HTML  Part of the page content Background-image or ?

Background Styles Live Demo

27  Gradients are smooth transitions between two or more colors  CSS gradients can replace images and reduce download time  Lots of gradient generators on the Web  Create a more flexible layout, and look better while zooming Gradient Backgrounds background: linear-gradient(#0000FF, #FFFF00);

Gradient Background Live Demo

29  CSS3 allows multiple background images  Simple comma-separated list of images  Comma separated list for the other properties Multiple Backgrounds background-image: url(sheep.png), url(grass.png);

Multiple Backgrounds Live Demo

Opacity

32  opacity : specifies the opacity of the element  Floating point number from 0 to 1  For old Mozilla browsers use –moz-opacity  For IE use filter:alpha(opacity=value) where value is from 0 to 100 ; also, "binary and script behaviors" must be enabled and hasLayout must be triggered, e.g. with zoom:1 Opacity opacity: 0.5;

Opacity Live Demo

Styling Lists Live Demo

Styling Forms Live Demo

Styling Tables Live Demo

37  Text-related properties define  Fonts, colors, text overflow, paragraphs  Borders  Rounded corners  Backgrounds  Images, gradients, multiple images  Opacity – 0%...100%  Styling lists, forms, tables Summary

? ? ? ? ? ? ? ? ? CSS Presentation

License  This course (slides, examples, demos, videos, homework, etc.) is licensed under the "Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International" licenseCreative Commons Attribution- NonCommercial-ShareAlike 4.0 International 39  Attribution: this work may contain portions from  "HTML Basics" course by Telerik Academy under CC-BY-NC-SA licenseHTML BasicsCC-BY-NC-SA  "CSS Styling" course by Telerik Academy under CC-BY-NC-SA licenseCSS StylingCC-BY-NC-SA

Free Software University  Software University Foundation – softuni.orgsoftuni.org  Software University – High-Quality Education, Profession and Job for Software Developers  softuni.bg softuni.bg  Software Facebook  facebook.com/SoftwareUniversity facebook.com/SoftwareUniversity  Software YouTube  youtube.com/SoftwareUniversity youtube.com/SoftwareUniversity  Software University Forums – forum.softuni.bgforum.softuni.bg