CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity

Slides:



Advertisements
Similar presentations
Web Engineering 1 Ishaq Khan Shinwari MCS City University Peshawar.
Advertisements

Session Objectives Setting the font family Setting the font size Working with Web fonts Setting font faces and sizes Setting font and text appearances.
1 Dynamic HTML: Cascading Style Sheets™ (CSS). 2 Introduction Cascading Style Sheets (CSS) –Specify the style of your page elements –Spacing, margins,
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.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
CSS Dvijesh Bhatt.
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.
(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
 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.
CSS Presentation CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity Svetlin Nakov Technical Trainer Software University
Jekyll Static Site Generator Template-Based Site Generation Svetlin Nakov Technical Trainer Software University
Web Development Tools Tools for Front-End Developers Writing HTML and CSS Code SoftUni Team Technical Trainers 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 Design (14) CSS Formatting Text. Formatting Text In Brackets, go to your ‘externalcss’ website and find the ‘formattingtext’ page. Use the ‘main’
CSS Fonts. The Font properties allow you to change the font family, boldness, size, and the style of a text.
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)
Cascading Style Sheets (Formatting). Slide 2 Lecture Overview (1) At this point, you have learned how and where to create styles Internal, embedded, external.
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,
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 10: Formatting Text with Styles.
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 – Properties & Values
The Internet 10/13/11 The Box Model
Presentation transcript:

CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity CSS Presentation CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity SoftUni Team Technical Trainers Software University http://softuni.bg © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

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

Text-Related CSS Properties

CSS Rules for Fonts and Paragraphs 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 Have different values in different browsers – Use pixels, em, rem, points 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” http://google.com/fonts - Google free fonts font-weight – can be normal, bold, bolder, lighter or a number in range [100 … 900]

CSS Rules for Fonts and Paragraphs (2) 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

Shorthand Font Property Shorthand rule for setting multiple font properties is equal to writing this: 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;

Text-Related Properties Live Demo

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

Text Shadow The text-shadow property applies a shadow to the text Does not alter the size of a box text-shadow: <horizontal-distance> <vertical-distance> <blur-radius> <shadow-color>; text-shadow: 2px 2px 7px #000000;

Text Overflow Specifies what should happen when text overflows the containing element ellipsis – displays ellipses (…) to represent the clipped text clip – default value, clips the text string – displays custom string as clipped text Only supported by Firefox text-overflow: ellipsis; text-overflow: clip; text-overflow: '..';

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

More Fonts Live Demo

Borders

Borders 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

Border Shorthand Property 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: 1px solid red; border-width: 1px; border-color: red; border-style: solid;

Borders Live Demo

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

Rounded Corners 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: border-radius: [<length>|<%>][<length>|<%>]? border-radius: 15px; border-radius: 15px 15px 15px 10px; border-radius: 15px 20px;

Other Border Styles Live Demo

Background Properties

Backgrounds background-image background-color background-repeat 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 background-image: url('background.gif');

Backgrounds (2) 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: background-position: top left; background-position: -5px 50%;

Background Shorthand Property 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: #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;

Background-image or <img>? 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 Styles Live Demo

Gradient Backgrounds 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 background: linear-gradient(#0000FF, #FFFF00);

Gradient Background Live Demo

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

Multiple Backgrounds Live Demo

Opacity

Opacity 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: 0.5;

Opacity Live Demo

Styling Lists Live Demo

Styling Forms Live Demo

Styling Tables Live Demo

Summary Text-related properties define Borders Backgrounds Fonts, colors, text overflow, paragraphs Borders Rounded corners Backgrounds Images, gradients, multiple images Opacity – 0%...100% Styling lists, forms, tables © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

CSS Presentation https://softuni.bg/courses/web-fundamentals/ © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

License This course (slides, examples, demos, videos, homework, etc.) is licensed under the "Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International" license Attribution: this work may contain portions from "HTML Basics" course by Telerik Academy under CC-BY-NC-SA license "CSS Styling" course by Telerik Academy under CC-BY-NC-SA license © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

SoftUni Diamond Partners

Free Trainings @ Software University Software University Foundation – softuni.org Software University – High-Quality Education, Profession and Job for Software Developers softuni.bg Software University @ Facebook facebook.com/SoftwareUniversity Software University @ YouTube youtube.com/SoftwareUniversity Software University Forums – forum.softuni.bg © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.