Cascading Style Sheets (CSS) Internal Style Sheets Classes

Slides:



Advertisements
Similar presentations
CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
Advertisements

CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Web Pages Week 10 This week: CSS Next week: CSS – Part 2.
Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets: Basics I450 Technology Seminar Copyright 2003, Matt Hottell.
Cascading Style Sheets (CSS) “Styles” for short. Pg. 418.
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.
Advanced Web Design Using Dreamweaver Robby Seitz 121 Powers Hall
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
1 Dreamweaver CS5 intermediate class by Cookie Setton Build a CSS website WITHOUT TABLES Just when you thought you were starting to understand HTML coding,
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.
ADVANCED CSS William Neely CEO, Piecewise.com. CSS FONTS AND TEXT CSS ‣ Line-height allows to indicate the amount of space between lines; allows for equal.
Unit 20 - Client Side Customisation of Web Pages
Chapter 8 Creating Style Sheets.
CSS normally control the html elements. Three Ways to Insert CSS There are three ways of inserting a style sheet: External style sheet Internal style.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
COMP101 – Exploring Multimedia and Internet Computing LA2 (Thur 14:00 – 16:50) TA: Jackie Lo.
Lecture Cascading Style Sheets (CSS) Internal Style Sheets Classes.
Web Workshop: CSS Objectives: - “What is CSS?” - Structure of CSS - How to use CSS in your webpage.
4.01 Cascading Style Sheets
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
WRT235: Writing in Electronic Environments CSS Classes, IDs, divs.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
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.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
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.
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.
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.
1 Cascading Style Sheets
WebD Introduction to CSS By Manik Rastogi.
CSS.
Working with Cascading Style Sheets
CSS Cascading Style Sheets
CSS HTML and website development.
4.01 Cascading Style Sheets
>> Introduction to CSS
IS 360 Declaring CSS Styles
Madam Hazwani binti Rahmat
>> CSS Rules Selection
Web Design & Development
Cascading Style Sheets
Introduction to Web programming
Cascading Style Sheets (Layout)
Intro to CSS CS 1150 Fall 2016.
Cascading Style Sheets
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Cascading Style Sheets: Basics
Website Design 3
Intro to CSS CS 1150 Spring 2017.
CS134 Web Design & Development
DynamicHTML Cascading Style Sheet Internet Technology.
CS134 Web Design & Development
Working with Cascading Style Sheets (CSS)
Working with Cascading Style Sheets (CSS)
DynamicHTML Cascading Style Sheet Internet Technology.
Training & Development
Web Design & Development
4.01 Cascading Style Sheets
Web Client Side Technologies Raneem Qaddoura
Introduction to Cascading Style Sheets (CSS)
Presentation transcript:

Cascading Style Sheets (CSS) Internal Style Sheets Classes Lecture Cascading Style Sheets (CSS) Internal Style Sheets Classes

Types of Styles Inline Styles – Styles that you type “inline” with each tag <h1 style="text-align: center;"> Internal Style sheets: Styles are defined for each page  <style type="text/css">        h1 {          color: purple;        }      </style> External style sheets: Styles are defined and linked to the entire site. <link rel="stylesheet" type="text/css" href="style.css">

Using Internal Style Sheets <html>    <head>      <title>This is a great page!</title>      <style type="text/css">        h1 {          color: purple;        }      </style>    </head>    <body>      <h1> Hello World! </h1>      <p> This is my <b>first page</b></p>    </body>  </html> Style element is inside <head> element Style definitions go inside <style> element

Placement of Internal Style Sheet

Using Different CSS Selectors Type Selector(What we’ve been using…) redefines the look of a specific tag A type selector matches every instance of the element type in the document tree E.g. body {background-color: #000000;} Class Selector (new) can apply to any tag E.g. .indent{margin-right:5%;margin-left: 5%;} In HTML, <p class=“indent”> pseudo-classes are used in CSS selectors to allow information external to the HTML source (e.g. the fact that an anchor has been visited or not) to classify elements.

Using Class Attribute Selectors CLASS is an HTML attribute that assigns a class name to any HTML element on a web page. Short cut to diversifying styles on your pages Can be used to identify which style sheet rules should be applied for the particular element of a web page

Using the Class Attribute Selector A class name is created by declaring a style rule in your style sheet and adding (.) flag character indicating that the selector is a class .red {color:red} .pink {color: #FF00FF} Add it to the HTML code of a web page by using the CLASS attribute <h2 class="red"> Company Description </h2>

Using the Class Attribute Selector For color or style variety: IN HTML CODE Inline style: <h1 style=“color: red"> Or Class (better!) <h1 class=“red"> <p class=“red"> <hr class=“red"> <li class=“red">

Using Different CSS Selectors When to use which? Use “type selector” when you want to apply certain style for all occurrences of a certain tag Use “class selector” if you want to apply the style for many (but not all) occurrences of a certain tag; OR if you want to apply the style for more than one type of tags

More Styling Options – DIV Boxes HTML Tag – <DIV> Creates a unique area on your webpage that can be styled with various indexes (like classes) Can be used together to help layout specific pages with greater control and style Everything in the box will have the same attributes The index is the same as a class except it is for elements like div boxes. Using the unique index you can style the div box for width, height, background, alignment, text, colors images etc.

DIV Boxes - Layouts Page styled by page tag in CSS (Background) White background set by DIV 1 Header area set by DIV 2 Navigation area set by DIV 3 Text area set by DIV 4 Left box area set by DIV 5 Footer area set by DIV 6

DIV Boxes - HTML <div id=“wrapper”> All controls for the div box are defined on the style sheet using this index <div id=“wrapper”> Information to include in the box or area – can be any web element including another div box </div>

Example Indexes #page { padding: 5px 45px 15px 45px; position: relative; width: 890px; margin: 0; } #foot { background-color: #cdcdcd; color: black; font-size: 8pt; text-align: center; padding: 5px 25px 0px 25px; width: 930px; #content-box1 { width: 320px; float: left; #content-box2 { margin: 0 0 0 335px; #wrapper { position: relative; width: 980px; height: auto; margin: 10px auto 10px auto; background: #FFFFFF; } #header { margin: 0px 0px 0px 0px; height: 200; padding: 25px 45px 25px 45px; width: 900px; #menu { height: 150; padding: 0px 0px 0px 0px; width: 975px;}

Understanding Classes Classes & indexes http://rainbow.arch.scriptmania.com/css/css_classes.html