1 Styles and CSS David Douglas Sam M. Walton College of Business, University of Arkansas “Connecting scholarship and research with business practice”

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

1 © Netskills Quality Internet Training, University of Newcastle Introducing Cascading Style Sheets © Netskills, Quality Internet.
Intro to HTML. HTML HTML = HyperText Markup Language Used to define the content of a webpage HTML is made up of tags and attributes Content.
CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
Learn about Cascading Style Sheets LACUNY Web Management Roundtable October 21, 2005
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
1 Cascading Style Sheets™ (CSS) Outline 5.1 Introduction 5.2 Inline Styles 5.3 Embedded Style Sheets 5.4 Conflicting Styles 5.5 Linking External Style.
Cascading Style Sheets (CSS) “Styles” for short. Pg. 418.
Cascading Style Sheets
Today CSS HTML A project.
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
Part 2 Introduction to CSS. CSS Syntax – class selector 1 With the class selector you can define different styles for the same type of HTML element. You.
Introducing CSS CIS 133 mashup Javascript, jQuery and XML 1.
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
Introduction to CSS.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
XP Introducing Cascading Style Sheets With Cascading Style Sheets (CSS), you can create one or more documents that control the appearance of some or all.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
Web Workshop: CSS Objectives: - “What is CSS?” - Structure of CSS - How to use CSS in your webpage.
1 Creating Web Pages Part 3. 2 CASCADING STYLE SHEETS (CSS): What exactly are they? Set of rules that define how a web browser should display an HTML.
4.01 Cascading Style Sheets
CM143 Week 4 Introducing CSS. Cascading Style Sheets A definition for the style in which an element of the webpage will be displayed Border width, colour,
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
STYLING THE WEBSITE - EXTERNAL CSS BY JORGE MARTINEZ.
 ult.htm ult.htm  This website illustrates the use of CCS (style sheets)
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
Introduction To CSS.. HTML Review What is HTML used for? Give some examples of formatting tags in HTML? HTML is the most widely used language on the Web.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
XHTML/CSS Week 3. This Week  Quiz to revise last week (XHTML and DW)  CSS - Part 2  Using HTML Tables.
CSS CSS is short for C ascading S tyle S heets. It is a new web page layout method that has been added to HTML to give web developers more control over.
IS 360 Declaring CSS Styles. Slide 2 Introduction Learn about the three ways to declare a style Inline / embedded / external Learn about the effect of.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Cascading Style Sheets Dreamweaver. Styles Determine how the HTML code will display Determine how the HTML code will display Gives designers much more.
Building Optimised Web Sites with CSS Folkert Klemme.
October 21, Learn about Cascading Style Sheets LACUNY Web Management Roundtable October 21, 2005
Cascading Style Sheets
Cascading Style Sheets Objective: Create an external style sheet, embedded style sheet, and an inline style to change the look and feel of a web site.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
Cascading Style Sheets I Embedded Style Sheets. Page Design ICSS 2Instructor: Sean Griffin What is a Style Sheet? A style sheet is a text file that contains.
CSS Hadas Kahsay. Overview  What is CSS  Basic syntax of CSS Rules  How to link CSS style to html documents  Browsers and CSS  Advantages of CSS.
How to… Cascading Style Sheets. How to Insert a Style Sheet When a browser reads a style sheet, it will format the document according to it. There are.
1 Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size, font color etc…
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
Cascading Style Sheets Using HTML. What are they? A set of style rules that tell the web browser how to present a web page or document. In earlier versions.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
WEB FOUNDATIONS CSS Overview. Outline  What is CSS  What does it do  Where are styles stored  Why use them  What is the cascade effect  CSS Syntax.
CSS Cascading Style Sheets
Web Development & Design Foundations with HTML5 8th Edition
>> Introduction to CSS
IS 360 Declaring CSS Styles
Madam Hazwani binti Rahmat
CX Introduction to Web Programming
Intro to CSS CS 1150 Fall 2016.
Web Development & Design Foundations with HTML5
Website Design 3
Cascading Style Sheets - Building a stylesheet
Introduction to CSS.
Intro to CSS CS 1150 Spring 2017.
CS134 Web Design & Development
Cascading Style Sheets (Introduction)
Introduction to Cascading Style Sheets (CSS)
Cascading Style Sheets (Introduction)
The Internet 10/6/11 Cascading Style Sheets
Web Design and Development
Web Design & Development
Cascading Style Sheets
Cascading Style Sheets - Building a stylesheet
Presentation transcript:

1 Styles and CSS David Douglas Sam M. Walton College of Business, University of Arkansas “Connecting scholarship and research with business practice”

Style and CSS Basics  Goal is to separate Style from Structure  Style rules express the style characteristics of an element  A set of style rules in an external document is a style sheet  Example of Style Section (sets elements in the document to 24 point blue) P {color: blue; font-size: 24pt;} … 2

Style and CSS Basics  A style rule is composed of two parts  Selector  Declaration h1 {color: red;} 3 Declaration Selector

Style and CSS Basics  A declaration is composed of two parts  Property  Value  Syntax is Property and colon, then value and semicolon to allow multiple declaration h1 {color: red;} 4 Value Property

Style and CSS Basics  Style rules can be applied to an element  Style rules can be a section in a document  Style rules can be in a document external to the Web pages to which it can be applied 5

Style and CSS Basics  Style rules can be applied to an element similar to an element attribute  Example 6

Style and CSS Basics  Example of a Style Section to be used for a Web page that sets h1 and h2 to a particular font and color of navy—Type Selector h1, h2 { font-family: 'Trebuchet MS'; Color: Navy; } 7

Style and CSS Basics  Example of an external style sheet—referred to as a cascading style sheet—note that the content is the same as a Style Section but in a file with a.css extension h1, h2 { font-family: 'Trebuchet MS'; example.css Color: Navy; } 8

Style and CSS Basics  Referencing an external cascading style sheet <title…. <link href="example.css" rel="stylesheet" type="text/css" /> 9

Style and CSS Basics  Grouping Selectors h1 {color: red;} h2 {color: red;} can be grouped with elements separated by commas h1, h2 {color: red;} 10

Style and CSS Basics  Combining Declarations p {color: blue;} p {font-size: 12pt;} can be expressed as follows p {color: blue; font-size: 12pt;} 11

Style and CSS Basics  Using Descendant Selectors  Selects only elements that are within elements p b {color: blue;} can be more than 2 selector elements ul li b {color: blue;} 12

Style and CSS Basics  Using the Class Attribute Selector.quote {color: blue; margin: 30px;} Reference the class This…. Note that this allows any element to use the style whereas a general style for an element applies to every instance of the element 13 Class Name Flag Character Declaration

Style and CSS Basics  Making Class Selectors More Specific h1.quote {color: blue; margin: 30px;} restricts the use of the quote to the element 14

Style and CSS Basics  Using the id Attribute Selector #preface {color: blue; margin: 30px;} reference the element This…. Note that the id value uniquely identifies this one element to which the rule applies 15 Class Name Flag Character Declaration

Style and CSS Basics  CSS font measurement units 16 Absolute UnitsUnit AbbrevDescription CentimetercmStandard metric cm InchinStandard US inch MillimetermmStandard metric mm PicapcEqual to 12 points PointPt72 points / inch

Style and CSS Basics  CSS font measurement units (cont) 17 Relative UnitsUnit Abbrev Description EmemThe width of a capital M in the current font—usually the same as the font size ExexThe height of the letter x in the current font PixelpxThe size of a pixel on the current monitor Percentage150%Sets a font size relative to the base font size

Style and CSS Basics  Absolute Font Size Keywords  xx-small  x-small  small  medium  large  x-large  xx-large  Relative Font Size Keywords  smaller  larger 18

Style and CSS Basics  Fonts  Family {font-family: san-serif;}  arial, courier …..  Shortcut property designation  p {font: 12pt arial bold;}  Text Spacing Properties  text-align  text-indent  …  Text –decoration properties  none, underline, overline, line-through, blink 19

Style and CSS Basics  Fonts  Vertical alignment {vertical-align: super;}  baseline, sub, super, top, text-top, middle, bottom, text-bottom, percentage  Transforming case{text-transformation: uppercase}  capitalize, uppercase, lowercase, none 20

Style and CSS Basics  Visual Formatting Model  Block elements ,, …  Allows specification of margin, border, and padding for all block-level elements  Inline elements  List-item 21

Style and CSS Basics 22

Style and CSS Basics  Box specification example p {margin-left; 2 em; margin-right; 2 em; padding-left; 2 em; padding-right; 2 em; border-right; solid thin black; background: white} 23

Style and CSS Basics  Special Box Properties  width  height  float  clear div {float: left; width: 200px;} 24