DynamicHTML Cascading Style Sheet Internet Technology.

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 (CSS) “Styles” for short. Pg. 418.
Today CSS HTML A project.
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
Part 5 Introduction to CSS. CSS Display - Block and Inline Elements A block element is an element that takes up the full width available, and has a line.
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.
กระบวนวิชา 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.
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.
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.
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
CSS Netcentric. What is CSS O CSS stands for Cascading Style Sheets O Styles define how to display HTML elements O Styles were added to HTML 4.0 to solve.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CSS Basic (cascading style sheets)
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
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.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
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…
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.
Creating Web Documents CSS examples (do more later) Lab/Homework: Read chapters 15 & 16. Work on Project 3, do postings.
1 Cascading Style Sheets
CSS: formatting webpages
WebD Introduction to CSS By Manik Rastogi.
Working with Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheet.
CSS Cascading Style Sheets
4.01 Cascading Style Sheets
( Cascading style sheet )
CSS: Cascading Style Sheets
Webpage layout using CSS
>> Introduction to CSS
Introduction to CSS.
Cao Yuewen SEEM4570 Tutorial 03: CSS Cao Yuewen
Introduction to the Internet
Madam Hazwani binti Rahmat
>> CSS Rules Selection
Introduction to Web programming
Intro to CSS CS 1150 Fall 2016.
Cascading Style Sheets
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
Cascading Style Sheets - Building a stylesheet
Introduction to CSS.
Intro to CSS CS 1150 Spring 2017.
MORE Cascading Style Sheets (The Positioning Model)
Cascading Style Sheets
Cascade Style Sheet Demo W3Schools. com: w3schools
CS134 Web Design & Development
What are Cascading Stylesheets (CSS)?
Cascading Style Sheets
Cascading Style Sheets™ (CSS)
DynamicHTML Cascading Style Sheet Internet Technology.
Introduction to CSS.
Made By : Lavish Chauhan & Abhay Verma
Web Design & Development
Cascading Style Sheets
Cascading Style Sheets - Building a stylesheet
4.01 Cascading Style Sheets
Web Programming and Design
Cascading Style Sheets™ (CSS)
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

DynamicHTML Cascading Style Sheet Internet Technology

What is DHTML? A collection of enhancements to HTML Combination of 11/23/2018 What is DHTML? A collection of enhancements to HTML To create dynamic and interactive websites Combination of Static Markup language (e.g., HTML) Client-side Scripting language (e.g., JavaScript) Presentation Definition Language (e.g., CSS) Document Object Model Defines the object-oriented model of a document  To allow programs to manipulate content/structure/style of documents  Example Internet Technology

Cascading Style Sheets 11/23/2018 Cascading Style Sheets CSS defines how to display HTML documents Specifies document’s font, color, margin, background image, etc. Enables separation of document content from presentation Change one external CSS file to change the display of an entire website A webpage can have multiple display formats CSS Types External CSS → in an external file Example Save CSS in an external .css file Reference the CSS file with <link> tag in the HEAD section <head><link rel="stylesheet" type="text/css" href="mystyle.css" /></head> Document-level CSS → embedded in the HEAD section Example Define CSS in the HEAD section Inline CSS → within an element tag Example Use the style attribute in an HTML tag Internet Technology

11/23/2018 Why “Cascading”? Multiple CSS can be applied to one document (in a cascading order) Styles defined later have a higher preference than those defined earlier e.g., External CSS  Document-level CSS  Inline CSS Institution-level styles (e.g., corporate logo and colors) Department-level styles Styles defined for a group of documents (e.g., report) Styles defined directly in HTML pages Internet Technology

CSS: Basic Syntax Selector  HTML element to style/format 11/23/2018 CSS: Basic Syntax Selector  HTML element to style/format e.g., body, h1, p, hr, ul, ol, etc. Declaration  Consists of Property & Value Declarations are separated by semicolon Property and value are separated by colon Property  Style attribute to change e.g., color, font-size, font-family, etc. Internet Technology

CSS: ID & Class Selectors 11/23/2018 CSS: ID & Class Selectors ID Selector Specifies a style for a single HTML element ID Selector name starts with ‘#’ #para1 { text-align:center; color:red; } Uses the ‘id’ attribute of HTML element to apply the style <p id=“para1’>CSS ID selector applied</p> Class Selector Specifies a style for a group of HTML element Useful for setting a same style for several elements Class Selector name starts with ‘.’ .center { text-align:center; color:red; } Uses the ‘class’ attribute of HTML element to apply the style <h1 class="center">Center-aligned heading</h1> <p class="center">Center-aligned paragraph.</p>  Example Internet Technology

External CSS Style document is defined in an external .css file 11/23/2018 External CSS Style document is defined in an external .css file HTML document calls style sheet through <link> element <HEAD> <LINK REL=“stylesheet” TYPE="text/css" href="style1.css“ > </HEAD> One CSS can be applied to multiple HTML Multiple CSS can be used by one HTML Example CGI JavaScript Internet Technology

Document-Level CSS Style is defined within a document’s HEAD section 11/23/2018 Document-Level CSS Style is defined within a document’s HEAD section <head> <title>CSS Examples</title> <style type=“text/css”> <!-- use the HTML comment to hide the style definitions from older browsers H1 { font-family: Verdana; font-size: 24px; } --> </style> </head>  Example Internet Technology

Inline CSS Style is defined within an HTML element 11/23/2018 Inline CSS Style is defined within an HTML element <P STYLE="text-indent: 1in; text-align: center”> Takes precedence over other styles Override styles for a specific element Tips use external CSS to apply to a group of pages use document-level CSS to override external CSS for a given page use inline CSS to override for a given element (use sparingly)  Example Internet Technology

CSS: DIV & SPAN DIV Tag SPAN Tag Apply a style to a group of tags 11/23/2018 CSS: DIV & SPAN DIV Tag Apply a style to a group of tags Group any number of HTML elements Block-level (i.e. includes a paragraph break) <div style=“text-align: center;”> <h1>Using DIV to group tags</h1> <p>Using DIV to group tags</p> </div> SPAN Tag Change the style of an element at a non-block level Enclose text No implied paragraph break <h3>Using <span style=“color:red;”>SPAN</span> to change color</h3>  Example Internet Technology

CSS: Box Model CSS can control the layout of elements as boxes 11/23/2018 CSS: Box Model CSS can control the layout of elements as boxes Box Model = a box (padding, border, margin) around HTML elements Margin – transparent area around border Border – colored area around padding & content Padding – area around content Content – area where text and images appear div.ex { width:220px; padding:10px; border:5px solid green; margin:10px; }  Example Internet Technology

CSS: Positioning Position Properties  top, bottom, left, right 11/23/2018 CSS: Positioning Position Properties  top, bottom, left, right Positioning Method Static Position (default) Element is placed according to the normal flow of the page top/bottom/left/right properties have no effect Relative Positioning Element is placed relative to its normal position “relative to”  (top/bottom/left/right distance) away from Fixed Positioning Element is placed in a fixed location relative to browser window Absolute Positioning Element is placed relative to its nearest positioned ancestor Absolutely positioned elements do not affect other elements’ positions Overlapping Elements Use “z-index” to set the stack order of elements  Example Internet Technology