Controlling Appearance the Old Way

Similar documents
Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

Appendix D CSS Properties and Values

CSS. Lecture 16 COMPSCI 111/111G SS 2018

CSS Lecture 16 COMPSCI 111/111G SS 2018

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

CSS: The Basics CISC 282 September 20, 2014

CSS Styles Quick Reference Guide

Reading 2.2 Cascading Style Sheets

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

CSS for Styling CS380

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

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

Cascading Style Sheet Quick Reference

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

Cascade Stylesheets (CSS)

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

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

COSC 2206 Internet Tools. CSS Cascading Style Sheets

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

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

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Introduction to Cascading Style Sheets

Fundamentals of Web Programming a

CSC 443: Web Programming

CSS.

CSS Tutorial Part 1: Introduction: A. Adding Style to a Web Page (3 options):

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

Lab Introduction to Cascading Style Sheets

Chapter 12: FORMATTING TEXT

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

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

Cascading Style Sheets (CSS)

CSS Cascading Style Sheets

escuela técnica superior de ingeniería informática

Lecture B3 Style : Algorithmic Thinking. Computing and Art : Nature, Power, and Limits CC 3.12: Fall 2007

CSC309 Programming on the Web week 3: css, rwd

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

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

HTML/XML. HTML Continued Introduction to CSS

INTERNATIONAL UNIVERSITY OF JAPAN Public Management and Policy Analysis Program Graduate School of International Relations

CSC 337. Cascading Style Sheets. Marty Stepp, Rick Mercer

Chapter 3 Style Sheets: CSS

Web Design and Development Tutorial 03

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

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

ID1354 Internet Applications

ICT IGCSE Practical Revision Presentation Web Authoring

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

Zen Garden. CSS Zen Garden

Assignments (4) Assessment as per Schedule (2)

CSS: formatting webpages

Introduction to Web Tech and Programming

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

Page Layout. 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning

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

Floats, Grids, and Fonts

> > > > Cascading Style Sheets basics

By Ryan Stevenson. Guidebook #3 CSS

Introduction to WEB PROGRAMMING

CASCADING STYLESHEETS

Styles, Style Sheets, the Box Model and Liquid Layout

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

Cascading Style Sheets. Overview and Basic use of CSS

CSS Box Model. Cascading Style Sheets

CSc 337 LECTURE 3: CSS

ITNP43: HTML Lecture 4

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

CMPT 165: More CSS Basics

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

ITNP43: HTML Lecture 5

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

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

Cascading Style Sheets Level 2

Methods for configuring Cascading Style Sheets. Applying style to element name selectors. Style Rule Basics. CMPT 165: Cascading Style Sheets

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

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

HTML (Hyper Text Markup Language) CSS. (Cascading Style Sheets) HTML: problems with styles. HTML: styles. CSS: specifications.

CSS. (Cascading Style Sheets) HTML (Hyper Text Markup Language) HTML: styles. 07/07/2011(mar'09) A.Lioy - Politecnico di Torino ( ) F.

CSS. Text & Font Properties. Copyright DevelopIntelligence LLC

CSS. (Cascading Style Sheets)

More CSS. <link href="filename" type="text/css" rel="stylesheet" /> CS380

8a. Cascading Style Sheet

Salvedicta. - Hans Selye CSC 210

UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

Creating and Building Websites


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

Web Engineering CSS. By Assistant Prof Malik M Ali

Module 2 (VII): CSS [Part 4]

ACSC 231 Internet Technologies

Tutorial 3: Working with Cascading Style Sheets

CSS: Layout Part 2. clear. CSS for layout and formatting: clear

Introduction to Computer Science Web Development

CS 350 Internet Applications I Name: Exam II (CSS) October 29, 2013

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

Web Site Design and Development Lecture 5

Transcription:

Webpages and Websites CSS Controlling Appearance the Old Way Older webpages use predefined tags - <i> </i> - italic text; <b> </b> - bold text attributes - Tables (and a few other elements) use specialized attributes» <table border bgcolor="yellow"> - Some tags are used only to apply attributes» <font color="#7f00ff face="comic Sans">hello</font> - but attributes are inconsistent between tags Use CSS Cascaded Style Sheets to control the appearance of elements - Precise, standardized, rules instead of inconsistent attributes and elements 1

So, what is CSS? Cascaded Style Sheets - HTML version 4.0 (and later) supports CSS styles in place of other properties. CSS rules consist of selectors that are associated with specified properties, which have values. Selectors are HTML elements, including: - <div> </div> and <span> </span> Internal style the <style > element is part of the webpage s head Individual elements are controlled by rules - element's name, followed by curly braces { } - properties and values listed inside the curly braces <head> <style type="text/css"> </style> </head> p { color: blue; background: yellow; } h1 { font-family: "Comic Sans MS"; color: #30ff00; } 2

Some Powerful Properties These properties can be applied to most elements: font-weight - values: bold, normal, lighter font-style - values: normal, italic, oblique border - specify width, style, color - example: border: 4px dashed gray; width, margin, padding Colors! - Elements can have:» text color» background color color» borders, which have a color - controls text/foreground color background - controls background color CSS properties: font-family serif - Times New Roman, Bitstream Charter sans-serif - Arial, Trebuchet, Luxi Sans monospace - Courier New, Lucida Console fantasy, cursive - Comic Sans MS, Zapf Chancery, Impact, A list of values is allowed. Example: - p {font-family: Arial, Luxi Sans, sans-serif} 3

A Few Font Examples 24pt Cursive: Blackadder ITC AR Decode Brush Script MT Lucida Handwriting 24pt Fantasy : Algerian Castellar Comic Sans MS Old English Text MT Smoke 24pt Serif: Times New Roman Garamond DejaVu Serif 24pt Sans Serif: Arial Tahoma DejaVu Sans 24pt Monospace: Courier New Consolas DejaVu Sans Mono Lucida Console activity Copy the poem from http://montcs.bloomu.edu/~bobmon/readings/ Language/pronunciation_poem.html Some words are the "subjects" of the poem put these in <em>..</em> tags - For example, "tough", "bough", etc. In the document head, make a CSS element for em that changes the font for these words 4

CSS properties: font-size length - pt units (72pt = 1 inch), a standard measure of fonts - px units (pixels), a display-dependent measure percentage (relative to other fonts) - 100% is medium - 120% is common for large absolute size - x-small, small, medium, large, x-large relative size - smaller, larger CSS properties: text color, background Both text color and background color can be controlled - color short for foreground-color - Basic colors: black, silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, aqua - Others? experiment Precise color control is possible with advanced techniques - Covered later 5

activity Add a rule to change the emphasized words' colors Add a rule to change the font-size as well CSS properties: border border property takes a trio of values, in order: - width, in pixels or pts - line-style» solid, dashed, dotted, inset, outset, double, groove, ridge - color, specified as for text, background Examples: - p { border: 4px solid #008080 } body { border: 10% dashed #4040ff } 6

activity Add borders to words, paragraphs How can we apply CSS? Internal define styles in the file's <head></head> section - We will focus on this approach Inline add a "style" attribute to a tag - the selector is implied - useful for ad hoc adjustments External define styles in a separate file - an advanced approach, for large websites 7

A CSS Example The <head></head> contains an internal style block, within <style></style> tags. The body contains one occurrence of inline style. Another CSS example source code This HTML document includes the border, font-size, and font-family properties. The next slide shows how two different, older browsers display it. 8

Another CSS Example as displayed by browsers Internet Explorer 6 (on the left) renders list and body borders incorrectly. Firefox 1.5 (on the right) handles lists better, and has a different "body" size. 9