Cascading Style Sheets Example

Slides:



Advertisements
Similar presentations
CSS Cascading Style Sheets. Contents{ 1. What is CSS? 1. A Brief History of CSS 2. Why to use Styles? 2. Syntax 3. Cascading Order 4. Examples of Properties.
Advertisements

Web Engineering 1 Ishaq Khan Shinwari MCS City University Peshawar.
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.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
CASCADING STYLE SHEETS CSS. 2 What CSS means?  CSS is an extension to basic HTML that allows you to style your web pages.  It separates the part that.
Web Design & Development Cascading Style Sheets (CSS)
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Cascading Style Sheets Cyndi Hageman. Applying a Style Sheet  In-line style – used within the HTML tag  Embedded Style Sheet – located in the HTML document.
CSE CASCADING STYLE SHEETS CSS Faculty of Computer Science and Engineering.
Controlling Page Style: Cascading Style Sheets (CSS) References: 1.Wang, P.S & Katila, S. (2004). A Introduction to Web Design and Programming. CA: Thomson.
1 Cascading Style Sheets C S S. 2 What is CSS? A simple mechanism for controlling the style of a Web document without compromising its structure. It allows.
Cascading style sheets - CSS
Computing Concepts: CSS. Aims  To understand the uses of css  To understand the different types of css  To be able to create a css file  To be able.
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
Cascading Style Sheets (CSS) Bartosz Sakowicz. CSS syntax Basic CSS syntax: selector { property:value } E.g.: P {font-family: Arial} H1 {font-size: 20pt}
CSSMR.Mostafa badr1. Lesson 3 Creating an Style Sheet Lesson 2 Structure of the Style Lesson 1: What Cascading Style Sheets are?
© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
Cascading Style Sheets Billy Toy Cascading Style Sheets Syntax review How to Implement style sheets Background properties Text properties.
CSS Dvijesh Bhatt.
HTML/CSS Hyper Text Markup Language. CSS Cascading Style Sheets.
1Computer Sciences Department. And use
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Cascading Style Sheets, pt 2 ECA 225 Applied Online Programming.
WDV 101 Intro to Website Development
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) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit E Formatting with Cascading Style Sheets.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
What is 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 External.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
CSS My favourite ICT lesson By Federico Boschi Cascading Style Sheets.
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
Cascading Style Sheets Chapter Four. What are they? A set of style rules that tell the web browser how to present a web page or document. Cascading Style.
CO1552 – Web Application Development Cascading Style Sheets.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Cascading Style Sheets in.NET Lilian Kiilu, Client/Server & Web Applications, Coms 463/563, Section 1pm, Fall 2005, November 16 th 2005.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
CHAPTER 3 CSS & CSS3 อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
MySQL and PHP Review CSS. Cascading Style Sheet (CSS) Style sheets are files or forms that describe the layout and appearance of a document. Cascading.
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
Lesson 03 // Cascading Style Sheets. CSS Stands for Cascading Style Sheets. We’ll be using a combination of Html and CSS to create websites. CSS is a.
Chapter 3 CSS. Vacabulary CSS: 层叠样式表 Syntax: 语法 Selector: 选择器 filter :滤镜 / 过滤器 background: 背景 property: 属性.
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
1 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
CSS – Cascading Style Sheets
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Designing Web Pages The case for CSS. The Power of CSS css Zen Garden
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
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.
IS1825 Multimedia Development for Internet Applications Lecture 12: IDs, Classes and Internal CSS Rob Gleasure
CSS Syntax. Syntax The CSS syntax is made up of three parts: a selector, a property and a value: selector {property: value}
1 CSS محمد احمدی نیا 2 Of 21 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements 
Basic Webpage Design Cascading Style Sheet (CSS).
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Welcome To Website Design, Hosting And Management Prepared By Webdev Solution ip ,223,96.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 4 Formatting Text and Links.
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 solve a problem External.
1 Cascading Style Sheets
WebD Introduction to CSS By Manik Rastogi.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
What are Cascading Stylesheets (CSS)?
Presentation transcript:

Cascading Style Sheets Example

What is 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 External Style Sheets can save you a lot of work External Style Sheets are stored in CSS files Multiple style definitions will cascade into one

Cascading Order 1.Browser default 2.External Style Sheet 3.Internal Style Sheet (inside the tag) 4.Inline Style (inside HTML element) So, an inline style (inside an HTML element) has the highest priority.

Syntax selector {property: value} Example:body {color: black} p {font-family: "sans serif"} p {text-align:center;color:red} Grouping: h1,h2,h3,h4,h5,h6 { color: green }

The class selector You can define different styles for the same type of HTML element p.right {text-align: right} p.center {text-align: center} This paragraph is right-aligned. This paragraph is center-aligned.

The class selector You can omit the tag name!.center {text-align: center} This heading will be center-aligned This paragraph will also be center-aligned.

How to insert a style sheet: External It is ideal when the style is applied to many pages body {background-color: tan} h1 {color:maroon; font-size:20pt} ttt abc.html mystyle.css

How to insert a style sheet: Internal.. is used when a single document has a unique style. p {margin-left: 20px} body {background-image: url("images/back40.gif")}....

Styles: Lists ul.disc {list-style-type: disc} ul.circle {list-style-type: circle} ul.square {list-style-type: square} ul.none {list-style-type: none} Coffee Tea o Coffee o Tea  Coffee  Tea Coffee Tea or etc…

Styles: Lists (more) Ordered list list-style-type: decimal or lower-roman or upper- roman or lower-alpha or upper-alpha … Image as a list-item marker list-style-image: url("/images/arrow.gif") Place: list-style-position: outside or inside {list-style: square inside url("/images/arrow.gif")}

Cascading Order: Inheritance External h3 { color: red; text-align: left; font-size: 8pt } Internal h3 { text-align: right; font-size: 20pt } Result color: red; text-align: right; font-size: 20pt

Styles: Text color: red or #00ff00 or rgb(0,255,0) text-align: center or left or right or justify text-indent: 1cm or 10% text-transform: uppercase or lowercase or capitalize

Styles: Font font-family: times or sans-serif … font-family: "lucida calligraphy", arial, 'sans serif'; font-style: italic or normal font-size: 150% or small or x-small or large or x-large … font-weight: bold or 100 … 900 or normal

Background body {background-color: yellow} h1 {background-color: #00ff00} h2 {background-color: transparent} p {background-color: rgb(250,0,255)}

Background image background-image: url("/images/bg.jpg")

Background image background-repeat: no-repeat or repeat repeat-y repeat-x

Background image background-repeat: no-repeat background-position: center center or top left or bottom right or x y or x% y% body { background-image: url("smiley.gif"); background-repeat: no-repeat; background-position: center center}

Margin CSS Margin properties define the space around elements. margin-top margin-right margin-bottom: 20 or = 20px or 20% or 20cm margin-left

Position h1 {position: absolute;bottom: 30px;right: 40px} h1 {position: absolute; top: 10%; left: 20%} Image: vertical-align: baseline or top or bottom …

Cursor style p {cursor: help} –crosshair –pointer –default –help –wait –…

Inline style Inside a tag as an attribute, but following the css description syntax This is a paragraph.

How to make invisible h1 {visibility:visible or hidden} h1 {display:none}

Other selectors Connect css and html using ID of an html element css: #example {color:blue} Html: somekind text Where instead of “example” you can write any text

Other selectors Formatting links (tag a): a:link {color:red} /* unvisited link */ a:visited {color:green} /* visited link */ a:hover {color:orange} /* mouse over link */ a:active {color:white} /* selected link */

Other selectors Othe pseudo elements (defined using “:”) css: p:first-line {color:green} html: Info css: p.inf:first-letter {color:blue} html: Info :first-childStyles first subelement (child) :first-lineStyles first text line :first-letterStyles first character

Media Defines how it looks on different media (hiding for example some elements in screen { p {font-family:verdana} print { p {display:none} screen,print { p.test {font-weight:bold} }

Other Forms: input[type="text"] {background-color:blue}