CSS Cascading Style Sheets

Similar documents
CSS Cascading Style Sheets

Cascading Style Sheets Level 2

CSS: The Basics CISC 282 September 20, 2014

CSS.

Web Development & Design Foundations with HTML5

Web Development & Design Foundations with HTML5

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

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

COMS 359: Interactive Media

Cascading Style Sheets (CSS)

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

Assignments (4) Assessment as per Schedule (2)

WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model)

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

Creating and Building Websites

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

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

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

Appendix D CSS Properties and Values

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

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

2. Write style rules for how you d like certain elements to look.

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

CSS: Cascading Style Sheets

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

Introduction to WEB PROGRAMMING

CSS: Cascading Style Sheets

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

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

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors

2005 WebGUI Users Conference

INTRODUCTION TO CSS. Topics MODULE 5

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

Deccansoft Software Services

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

Styles, Style Sheets, the Box Model and Liquid Layout

ITNP43: HTML Lecture 4

Introduction to Web Tech and Programming

HTML/CSS. HTML review and extra CSS review CSS Color

Tutorial 3: Working with Cascading Style Sheets

WEBSITE PROJECT 2 PURPOSE: INSTRUCTIONS: REQUIREMENTS:

Reading 2.2 Cascading Style Sheets

Cascading Style Sheet. Styles as Tag Attributes. Syntax. <h1>: what font type/size is used? STYLE = SELECTOR {RULES} Attributes such as bgcolor

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

Chapter 4 CSS basics

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

The internet is a worldwide collection of networks that link millions of computers. These links allow the computers to share and send data.

8a. Cascading Style Sheet

Web Site Design and Development Lecture 5

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

ID1354 Internet Applications

Client-Side Web Technologies. CSS Part I

READSPEAKER ENTERPRISE HIGHLIGHTING 2.5

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

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

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

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar with Dynamic Background Image

INTRODUCTION TO HTML5! CSS Styles!

Let s start with the document tree

INTRODUCTION TO CSS. Mohammad Jawad Kadhim

BIM222 Internet Programming

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

Chapter 3 Style Sheets: CSS

Lab Introduction to Cascading Style Sheets

The Benefits of CSS. Less work: Change look of the whole site with one edit

Intermediate Web Publishing: Working with Styles

CSS. Selectors & Measurments. Copyright DevelopIntelligence LLC

In the early days of the Web, designers just had the original 91 HTML tags to work with.

HTML + CSS. ScottyLabs WDW. Overview HTML Tags CSS Properties Resources

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

ACSC 231 Internet Technologies

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

CSS 1: Introduction. Chapter 3

Web Engineering CSS. By Assistant Prof Malik M Ali

.hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in; } .tube {

Unveiling the Basics of CSS and how it relates to the DataFlex Web Framework

COMS 359: Interactive Media

HTML and CSS COURSE SYLLABUS

Multimedia Systems and Technologies Lab class 6 HTML 5 + CSS 3

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

COSC 2206 Internet Tools. CSS Cascading Style Sheets

CSS3 Basics. From & CSS Visual Dictionary Learning Curve Books, LLC

Introduction to HTML & CSS. Instructor: Beck Johnson Week 2

This tutorial will help both students as well as professionals who want to make their websites or personal blogs more attractive.

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

HTML/XML. HTML Continued Introduction to CSS

CSS worksheet. JMC 105 Drake University

CITS3403 Agile Web Development 2019 Semester 1

Shane Gellerman 10/17/11 LIS488 Assignment 3

Using Advanced Cascading Style Sheets

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 3 Introduction to CSS

CSS is applied to an existing HTML web document--both working in tandem to display web pages.

CHAPTER 4 CASCADING STYLE SHEETS BASICS KEY CONCEPTS

Which is why we ll now be learning how to write in CSS (or cascading sheet style)

Web Site Design. Stanford University Continuing Studies CS 03. Mark Branom

Transcription:

CSS Cascading Style Sheets

site root index.html about.html services.html stylesheet.css charlie.jpg

Linking to your HTML You need to link to your css in the <head> of your HTML file. <head> <link href="stylesheet.css" rel="stylesheet" type= text/css > </head>

The Little Mermaid The is a story about a half girl, half fish. Pretty unbelievable, I know. Im not sure how Disney managed to trick millions of little kids into thinking Ariel is a real being to empathize with. In any case, an gives her a pair of legs to walk so that she can meet prince charming, but then steals her voice. Somehow without ever knowing who she is because she has no voice he decides to marry her. And they lived happily ever after. Hmm... skeptical.

Selectors and Declarations A CSS rule contains two parts: a selector and a declaration. h1 { font-family: serif; }

Selectors indicate which element the rule applies to. h1 { font-family: serif; }

Declarations indicate how the elements selected are to be styled. They are made up of two parts: property and value. The property is what you want to change, and the value is the value is that change. h1 { font-family: serif; }

You can specify many declarations for each selectors just separate them by a semicolon. h1 { font-family: serif; font-size: 20px; color: pink; }

align background-color background-image border cellpadding cellspacing color float font font-family font-size font-style font-weight height href letter-spacing margin name padding rel src title text-align text-decoration text-indent text-transform white-space width word spacing

CSS Selectors Universal *{ } Targets all elements on the same page Text h1, h2, h3 { } Targets all the <h1> <h2> <h3> elements Child li>a { } Targets any <a> elements that are children of an <li> element (but not other <a> elements in the page) Descendent p a { } Targets any <a> elements in the <p> element, even if it is not a direct child)

Naming Elements with an ID or Class To have more control over your css you can name your HTML elements with an ID or Class. Identifiers (ID) are unique names given to an element. A class can be used to name more than one element. Name your <div> with an ID or class within the opening tag of the element: <div id= sidebar > </div> <div class= left-column > </div>

In your CSS document, ID selectors begin with a hashtag, and class selectors begin with a period: ID html <div id= sidebar > </div> css #sidebar { float: left; } Class html <div class= left-column > </div> css.left-column { float: left; }

Types of CSS External Internal Inline

External CSS An external style sheet is a text document with a.css extension that links to your HTML page from the <head> element. This allows all of your webpages to share the same style sheet. <head> <link href= stylesheet.css type= text/css rel= stylesheet /> </head>

Internal CSS Embedded styles are found in the <head> of your HTML document. Embedded styles only apply to that one page. <head> <style type= text/css > body { font-family: arial; } </style> </head>

Inline CSS Inline styles are nestled in with the HTML syntax using a style attribute. Inline styles are used to override external style sheets and only apply to that one element. <p>the quick <style= color: red >red</style>fox jumped over the six lazy <style= color: brown >brown</style>dogs.</p>

Color RGB rgb(89,0,127) RGBa rgba(89,0,127,0.5) Color red HEX #ff3344

h1 { color: rgb(140,200,238); } h1 { color: rgba(140,200,238,0.5); } h1 { color: red; } h1 { color: #ff3344; }

font-family The font-family property allows you to specify a typeface. p { font-family: Georgia, Times, Serif; } You can specify a list of fonts separated by commas so that if the user does not have your first choice typeface installed, the browser can try to use an alternative font from the list.

Google Fonts google.com/webfonts provides you with the css code to paste into the <head> of your html so that you can set that font in your css fontfamily

font-size There are several ways to specify the size of a font: pixels, percentages or em.

px 1 px = 1 pt % 100% = 16px (default size of body text in the browser all percentages are in relation to 16px) em 1em = 16px (default size of body text in the browser all Ems are in relation to parent s font size)

color font-family font-size font-weight font-style text-transform text-decoration text-align text-indent text-shadow line-height letter-spacing word-spacing vertical-align

Box Model #box { font-size:.6em; color: #fff; width: 100px; height: 100px; This is the content that is contained within the box. This applies to text and images. }

When setting heights and widths for an element in CSS you must take into account accurate measurements for all your boxes properties (i.e. padding, margins, etc). This is the content that is contained within the box. This applies to text and images..column { width: 300px; padding: 10px; margin: 25px; } Actual width = 280px

Box Dimensions When using percentages, the size of the box is relative to the size of the browser window, or if the box is encased within another box, it is a percentage of the size of the containing box. When using ems, the size of the box is based on the the size of the text that it sits inside of.

border border-top border-right border-bottom border-left border-size border-style border-height border-width margin margin-top margin-right margin-bottom margin-left padding padding-top padding-right padding-bottom padding-left

Formatting Link States a:link { color: red; } a: visited { color: orange; } a: active { color: purple; } a: hover { color:yellow; } Note: Must be in this order!