The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations).

Similar documents
Adding CSS to your HTML

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2)

Reading 2.2 Cascading Style Sheets

Review Question 1. Which tag is used to create a link to another page? 1. <p> 2. <li> 3. <a> 4. <em>

Creating A Website - Part 1: Web Design principles, HTML & CSS. CSS Color Values. Hexadecimal Colors. RGB Color

HTML/XML. HTML Continued Introduction to CSS

CSS: The Basics CISC 282 September 20, 2014

Introduction to CSS. Fijihosting.com Introduction to CSS page 1. What are style sheets? Lovely! How do I use them?

1 of 7 11/12/2009 9:29 AM

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

ACSC 231 Internet Technologies

INFORMATICA GENERALE 2014/2015 LINGUAGGI DI MARKUP CSS

Appendix D CSS Properties and Values

CSS. Text & Font Properties. Copyright DevelopIntelligence LLC

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

COSC 2206 Internet Tools. CSS Cascading Style Sheets

Web Site Design and Development Lecture 6

Lecture 10. CSS Properties. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

3.1 Introduction. 3.2 Levels of Style Sheets. - HTML is primarily concerned with content, rather than style. - There are three levels of style sheets

Chapter 12: FORMATTING TEXT

- The CSS1 specification was developed in CSSs provide the means to control and change presentation of HTML documents

Introduction to Web Design CSS Reference

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations

Introduction to Web Design CSS Reference

- HTML is primarily concerned with content, rather than style. - However, tags have presentation properties, for which browsers have default values

CMPT 165: More CSS Basics

CSS Selectors. element selectors. .class selectors. #id selectors

Web Development & Design Foundations with HTML5

Multimedia for the Web: Creating Digital Excitement. Multimedia Element Text

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

Web Development & Design Foundations with HTML5

Chapter 7 Typography, Style Sheets, and Color. Mrs. Johnson

CSS: Formatting Text. CSS for text processing: font-family. Robert A. Fulkerson

IDM 221. Web Design I. IDM 221: Web Authoring I 1

LBS Polytechnic. Hey! Make With The Style Sheet Already, Bub!

EECS1012. Net-centric Introduction to Computing. Lecture 3: CSS for Styling

CSS Styles Quick Reference Guide

Introduction to Web Tech and Programming

CASCADING STYLE SHEETS (CSS) BY: RIHAM ALSMARI, PNU. Lab 4

Chapter 4 CSS basics

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

Comp-206 : Introduction to Software Systems Lecture 23. Alexandre Denault Computer Science McGill University Fall 2006

ICT IGCSE Practical Revision Presentation Web Authoring

CASCADING STYLESHEETS

Cascading Style Sheets (CSS)

CSS Cascading Style Sheets

**Method 3** By attaching a style sheet to your web page, and then placing all your styles in that new style sheet.

Activity 4.1: Creating a new Cascading Style Sheet

CSS. Lecture 16 COMPSCI 111/111G SS 2018

Web Development & Design Foundations with HTML5, 8 th Edition Instructor Materials Chapter 3 Test Bank

How to create and edit a CSS rule

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

Tutorial 3: Working with Cascading Style Sheets

Html basics Course Outline

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

CS 1100: Web Development: Client Side Coding / Fall 2016 Lab 2: More HTML and CSS

Fonts, text, and colour on the web. Sourcing, resizing, and inserting web site images MGMT 230 LAB

Using CSS in Web Site Design

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

Admin. Midterm 1 on. Oct. 13 th (2 weeks from today) Coursework:

CSS Lecture 16 COMPSCI 111/111G SS 2018

Introduction to CSS. Part 1: Simple Text Formatting. Source Files for this Exercise are available on the Course Website DW_CSS intro

Cascading Style Sheets. Overview and Basic use of CSS

CSc 337 LECTURE 3: CSS

CSS Cascading Style Sheets

In this project, you ll learn how to create a webpage for your favourite recipe.

Three Ways to Use CSS:

WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5

By Ryan Stevenson. Guidebook #3 CSS

Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS. 8 Oct 2015

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

Chapter 2 CSS for Style

Cascade Stylesheets (CSS)

By completing this practical, the students will learn how to accomplish the following tasks:

ITNP43: HTML Lecture 4

CSS for Styling CS380

Zen Garden. CSS Zen Garden

COMSC-031 Web We S ite Site Development Development- Part 2 Part-Time Instructor: Joenil Mistal November 7, 2013

CSE 154 LECTURE 3: MORE CSS

Using Dreamweaver. 6 Styles in Websites. 1. Linked or Imported Stylesheets. 2. Embedded Styles. 3. Inline Styles

8a. Cascading Style Sheet

HTML TUTORIAL ONE. Understanding What XHTML is Not

Web Design and Development ACS-1809

Fundamentals of Web Programming a

CSC 121 Computers and Scientific Thinking

CSC 443: Web Programming

ID1354 Internet Applications

CSCB20 Week 7. Introduction to Database and Web Application Programming. Anna Bretscher Winter 2017

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

To link to an external stylesheet, the link element is placed within the head of the html page:

CSS.

UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013

CS105 Course Reader Appendix A: HTML Reference

Cascading Style Sheets Level 2

CSS means Cascading Style Sheets. It is used to style HTML documents.

Transcription:

WDI Fundamentals Unit 4 CSS Cheat Sheet Rule The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations). Declaration A declaration is made up of a property and a value, separated by a colon and punctuated by a semicolon. Selector The actual HTML object that the declaration(s) apply to. Property The characteristic of the selector that will be changed. Value The amount or type of change to be applied to the corresponding property of the matched selector. Marking-Up The process of assigning HTML tags to given text content in order to indicate its relation to the rest of the text or dictate how it should be displayed. Serif Font One of two general categories of fonts (typefaces) that uses marks (called "serifs") to embellish characters at the end of strokes. A common serif font is Times New Roman. Sans-Serif Font One of two general categories of fonts that do not embellish characters at the end of strokes ("sans serif" means "without serif"). A common sans-serif font is Helvetica. Class

A class attribute is added to an HTML element in order to provide a "hook" to refer to that element in your CSS. CSS class selectors begin with a.. Classes can be used multiple times per page and are used for styling groups of elements. ID An ID attribute is added to an HTML element in order to provide a "hook" to refer to that element in your CSS. CSS ID selectors begin with a #. Unlike classes, IDs can only be used one time per page. Classes vs. IDs Classes and IDs are ways of targeting the style of specific HTML elements on your page. So, what's the difference between them? In short, classes allow you to style many elements with a particular style, while IDs are only capable of styling a single element. Using these selectors allows you flexibility and control of styling individual, as well as groups, of elements on your page. Horizontal Rule Add a horizontal line across your page using the hr tag. Line Break Break up a block of text using the br tag. Image Add images to your HTML using the img tag. Tell the browser the source of the image file with an src attribute. Absolute File Path A path to a website or file that includes a full web address (starting with "http") that the browser loads from the remote location directly. For example: <img src="http://imgur.com/awesomedog.jpg"> Relative File Path A path to a website or file that gives you the path to the resource you are looking for as it relates to your website's local file structure. For example, if you wanted to retrieve an image called "newlogo.png" that resides in a directory called images, you would enter the following relative address: <img src="images/newlogo.png"> Why Separate HTML from CSS?

Separating HTML from CSS offers you scalability and versatility. If you separate how your site looks from what your site says, things become more flexible. You can make a change in one place and have it apply to your whole site, and apply any number of different styles to the same content. CSS Color Treatment While color names are fine when you're just beginning, there's a number of reasons you'll want to switch over to something more advanced. First, color names are rendered differently by different browsers. Second, there are only 147 color names accepted as standard, meaning your options are pretty limited. Instead, you'll want to use either RGB or hexadecimal codes. Both of these are built on a system of entering values for the colors red, green, and blue. By mixing different intensities of these three colors, you can create millions of different colors and shades. Intensity values range from 0 (no intensity) to 255 (full intensity) in the RGB system. In hex, they range from 0-9, then continue from A-F, with two characters each for red, green, and blue. This is clearer with examples, so here are some common colors with their RGB and Hex equivalents. The format for color names, RGB, and hexadecimal should look like the following, respectively: p { p { color: red; color: (255,0,0); p { color: #FF0000; CSS Text Treatment font-family To adjust the font of your selected text element, use the font-family property. For the value, enter the name of the font to which you'd like to alter your text. To be safe, put a comma after your selected font and enter a generic family as a fallback. If the web browser doesn't support the font you selected, it will choose the fallback. font family: Arial, sans serif; If your selected font is more than one word, capitalize both words and put them in quotation marks.

font family: "Courier New", monospace; font-size To increase or decrease the spacial dimensions of your chosen text, use the font-size property. As a beginner, you should enter pixel values for your font-size values. h3 { font size: 24px; As you become more advanced, try using percentages or ems instead of pixels. font-weight To adjust the thickness of your selected text, use the font-weight property. As a beginner, you can enter values like "normal" to make your text thin and "bold" to make your text thick. As these values aren't very specific, different browsers may interpret their display with slightly different outputs. font weight: normal; font weight: bold; As you become more advanced, try using the numbers 100, 200, 300, 400, 500, 600, 700, 800, and 900 as values to gain more granular control. With this system, 400 is roughly equivalent to "normal" and 700 roughly equals "bold." font weight: 400; font weight: 700; font-style To make normal text italic, use the property font-style and the value "italic." To reverse this effect, use the value "normal."

a { a { font style: italic; font style: normal; text-align To adjust the positioning of a text element, use the CSS property "text-align" and one of the following values: left, right, center, or justify. body { text align: center; text-decoration To add an underline to normal text, use the CSS property "text-decoration" and the value "underline." text decoration: underline; To remove underlines, use the value "none." This declaration is often applied to anchor tags. a { text decoration: none; Less commonly used values include "overline" to add a line above text and "line-through" to strike a line through your text. text-transform To adjust capitalization in a selected text element, use the "text-transform" property. Values for this property include "uppercase" to make every letter capitalized, "lowercase" to make every letter uncapitalized, and "capitalize" to make the first letter of every word in the selected text capitalized. text transform: uppercase;

<img src="http://i.imgur.com/z9ggd0t.jpg" alt="grumpy Cat hates bad design" title="grumpy cat">