WRT235: Writing in Electronic Environments CSS Classes, IDs, divs.

Slides:



Advertisements
Similar presentations
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Advertisements

Cascading Style Sheets
Cascading Style Sheets
Today CSS HTML A project.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
CSW131 Steven Battilana 1 CSW 131 – Chapter 5 (More) Advanced CSS Prepared by Prof. B. for use with Teach Yourself Visually Web Design by Ron Huddleston,
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
กระบวนวิชา 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.
9-May-15 More CSS. 2 A different emphasis CSS is the same for XML as it is for HTML and XHTML, but-- XML contains no display information If you want your.
Lecture Cascading Style Sheets (CSS) Internal Style Sheets Classes.
Streamlining Website Development in Dreamweaver Roger L. Runquist Western Illinois University Roger L. Runquist Western Illinois University.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
4.01 Cascading Style Sheets
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
Multimedia & The World Wide Web winny HCI 201 Multimedia and the www.
ITP 104.  While you can do things like this:  Better to use styles instead:
CSS Introduction Cascading Style Sheets Provides a great deal of control over the presentation of the document HTML indicates both semantics of a document.
CSS – Presentation of Information. Types of Style Sheets External Embedded h1{color:red; font-family: Arial;} Inline Text is here.
1 Cascading Style Sheets (CSS) Part 2. 2 The Sources of Style Sheets.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border 
WRT235: Writing in Electronic Environments Basic CSS.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Lecture 2 - HTML and CSS Review SFDV3011 – Advanced Web Development 1.
Using the CSS. What is CSS? CSS is a language that’s used to define the formatting applied to a Website, including colors, background images, typefaces.
WRA HTML & CSS – BUILDING WEBPAGES. TODAY’S AGENDA Review: external stylesheets Review: transforming a list Intro: the object Intro: the.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
>> The “Box” Model. Pre-requisite Create a new project in Netbeans called Week5 Create a new html file and name it box.html Create a new css file and.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
CSS  Basic rules of CSS  Pseudo-class of the A tag  Apply CSS to alter an unordered list Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS Box Model  CSS properties for border  CSS properties for.
11/12/2015 Box Model Reed Crouch. 11/12/2015  HTML elements can be considered as boxes. In CSS, the term "box model" is used when referring to layout.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
Lecture 2: Cascading Style Sheets (CSS) Instructor: Dr. M. Anwar Hossain.
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.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
CSS FOUNDATIONS IN-DEPTH The nitty-gritty of css...
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
CSS Box Model. What is the Box Model? Each XHTML element appearing on our page takes up a "box" or "container" of space. Each box size is affected not.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Chapter 4 and 5. Objectives Introduce markup: elements and attributes How browsers interpret HTML documents Basic structure of HTML document What do style.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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.
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.
CSS (Cascading Style Sheets). CSS CSS – Cascading Style Sheets – Cascade because of the way CSS rules can stack on top of each other. Allows you to add.
CSS.
Cascading Style Sheets (CSS) Internal Style Sheets Classes
Working with Cascading Style Sheets
CSS Box Model.
CSS Box Model.
4.01 Cascading Style Sheets
( Cascading style sheet )
CSS Layouts: Grouping Elements
Cascading Style Sheets (Layout)
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Styles and the Box Model
CSS Box Model.
What are Cascading Stylesheets (CSS)?
Training & Development
CSS Box Model.
4.01 Cascading Style Sheets
Web Programming and Design
Presentation transcript:

WRT235: Writing in Electronic Environments CSS Classes, IDs, divs

Agenda  Review CSS Styles  Discuss Separation of Form and Content  Discuss Classes, IDs, and Targets

Three Methods of CSS  External  CSS saved in a separate.css file – reusable  Embedded  CSS in the of an XHTML document within tags  Can only be used by that specific document  Inline  CSS embedded in an object using style attribute – e.g.  Order of inheritance: External > Embedded > Inline – i.e., each subsequent style overrides the previous

External Style Sheets  Reusable  1.css file for many documents  Change 1 file to change all pages in a site  Separate.css file  Use text editor to create  Save as style.css (note:.css files can be named anything)  Relative link to your stylesheet from

style.css  No need for tag  Rules written like embedded CSS  p {color: #ffffff}  p { color: #fffff; background: # }

CSS Class Selectors  Apply styles to objects of a class – think the nouns of your HTML document (,,, ) p { color: #ffffff: } All objects take this style p.different { background:blue; } All with class “different”

CSS ID Selectors  Apply styles to objects with a unique ID #pizza { color: #ffffff: } Object with ID “pizza” gets this style p#pizza { background:blue; } Only paragraphs with ID pizza get this style

CSS Class & ID Selectors  Classes can apply to multiple objects  In HTML:  IDs apply to unique objects  In HTML:

New Object Type:  Short for division  Used to contain objects  Can contain other objects  Purpose is to group related content  Example: headers  Example: footers  Can have id and style attributes

Example My Cool Website Home About Resume

Example  Notice how each tag contains an id.  Because all open tags have ids, you can style divs in your CSS

Activity  Download the HTML stub from the course Homepage  Create objects in the XHTML and contain objects  Be sure to use open and close tags  When closing tags use comments to indicate the end of a container – e.g.,  Be sure to give each an id attribute – e.g.,

Objects  objects function like tags  Difference:  tags target block elements  tags target in-line elements  Example of using the class.warning:.warning {color:red; font-weight:bold} This is very important step.

Notes on and  Semantically meaningless on their own  Should be used sparingly, especially the tag  Why?  A lot of effort to maintain across pages and pages of HTML markup  Better alternatives

CSS Box Model  Every object has 5 properties that control size and positioning on a page:  margin  padding  border  height  width  Everything is box

CSS Box Model :: Margin  Space outside the border of an object  Creates white space between objects  Value in pixels  Control 4 sides or indvidual sides  Example rules:  margin: 20px;  margin-right:10px;

CSS Box Model :: Border  Edges surrounding object  Between margin and padding  Can control value for each edge or entire border  Example rules:  border: 1px solid black  border-left: 2px dashed black;

CSS Box Model :: Width  Size of an object from padding-left edge to padding-right edge  Does not include values from padding, border, or margin  Example rules:  width: 900px

CSS Box Model :: Height  Size of an object from padding-top edge to padding-bottom edge  Does not include values from padding, border, or margin  Example rules:  height: 360px

CSS Box Model Question  Given the following rules: #quiz { margin: 5px; border: none; padding: 10px; width: 400px; } How wide is #quiz on the screen?

CSS Box Model  Properties of objects control positioning and size  Allows us to create layouts and move objects around to match our designs