1 CSS محمد احمدی نیا 2 Of 21 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements 

Slides:



Advertisements
Similar presentations
Cascading Style Sheets Alternative to HTML tag style.
Advertisements

CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
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.
Computer Applications II.  A Style Sheet is a web page development tool that allows the developer to make global changes to a web page (or web site)
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.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
CSS(Cascading Style Sheets )
กระบวนวิชา 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.
CSS Cascading Style Sheets Brief Introduction
Design, Formatting, CSS, & Colors 27 February, 2011.
Controlling Page Style: Cascading Style Sheets (CSS) References: 1.Wang, P.S & Katila, S. (2004). A Introduction to Web Design and Programming. CA: Thomson.
4.01 Cascading Style Sheets
CSSMR.Mostafa badr1. Lesson 3 Creating an Style Sheet Lesson 2 Structure of the Style Lesson 1: What Cascading Style Sheets are?
Creating Web Pages with HTML and CSS ISY 475. HTML Introduction History: – Standard.
Using Cascading Style Sheets (CSS) Dept. of Computer Science and Computer Information CSCI N-100.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
Chapter 8 Cascading Style Sheets (CSS). Agenda Definition of a CSS style Types of CSS Styles CSS Backgrounds CSS Text CSS Fonts CSS Links CSS Lists CSS.
Review HTML  What is HTML?  HTML is a language for describing web pages.  HTML stands for Hyper Text Markup Language  HTML is not a programming language,
IT Introduction to Website Development Welcome!
Cascading Style Sheets Example
CSS Dvijesh Bhatt.
1Computer Sciences Department. And use
Doman’s Sections Information in this presentation includes text and images from
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.
To Proudly supported by ferrycake.com. We will be printing Cash for your Community tokens every week in the Carmarthen Journal and Llanelli Star. The.
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.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
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.
CIT Internet Based Programming Lecture notes: Week 4 Instructor:Dr. Tolgay KARANFİLLER.
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.
Cascading Style Sheets (CSS)
آموزش طراحی وب سایت جلسه چهارم– سی اس اس 1 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
INTRODUCTION TO CSS. OBJECTIVES: D EFINE WHAT CSS IS. K NOW THE HISTORY OF CSS. K NOW THE REASON WHY CSS IS USED. CSS SYNTAX. CSS ID AND CLASS.
Overview: 1. Discussion of the basic architecture of a web application. 2. Discussion of the relevance of using MySQL and PHP in a web application.
CSS Font CSS font properties define the font family, boldness, size, and the style of a text. CSS Font Families Generic family Font familyDescription Serif.
CSS Basic (cascading style sheets)
CSS -- TEXT.  Text Color  The color property is used to set the color of the text.  With CSS, a color is most often specified by:  a HEX value - like.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
DIV, Span, CSS.
HTML GUIDE Press F5 and then Click on the links on the left to get to the section you want Section 1: Getting Started Section 2: Moving Banner Section.
REEM ALMOTIRI Information Technology Department Majmaah University.
CSS – Cascading Style Sheets
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
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.
Company LOGO In the Name of Allah,The Most Gracious, The Most Merciful King Khalid University College of Computer and Information System Web pages Development.
Css lectures. 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.
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. 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
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.
WebD Introduction to CSS By Manik Rastogi.
CSS.
Cascading Style Sheet.
CSS: Cascading Style Sheets
CSS Cascading Style Sheets Brief Introduction
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
Cascading Style Sheets - Building a stylesheet
محمد احمدی نیا CSS محمد احمدی نیا
What are Cascading Stylesheets (CSS)?
Cascading Style Sheets
Cascading Style Sheets - Building a stylesheet
Kanida Sinmai CSS – Cascading Style Sheets Kanida Sinmai
Presentation transcript:

1 CSS محمد احمدی نیا

2 Of 21 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 a lot of work  Completely restyle a web site with only a few changes to your CSS code  External Style Sheets are stored in CSS files زبانهای برنامه سازی وب

3 Of 21 CSS Syntax  A CSS rule has two main parts: a selector, and one or more declarations:  The selector is normally the HTML element you want to style.  Each declaration consists of a property and a value.  The property is the style attribute you want to change. Each property has a value. زبانهای برنامه سازی وب

4 Of 21 CSS Syntax  A CSS declaration always ends with a semicolon  declaration groups are surrounded by curly brackets: p {color:red;text-align:center;} To make the CSS more readable, you can put one declaration on each line, like this: p { color:red; text-align:center; } زبانهای برنامه سازی وب

5 Of 21 CSS Syntax  CSS Comments  A CSS comment begins with "/*", and ends with "*/", like this: p { text-align:center; /*This is another comment*/ color:black; font-family:arial; } زبانهای برنامه سازی وب

6 Of 21 CSS Id and Class  CSS allows to specify selectors called "id" and "class". زبانهای برنامه سازی وب

7 Of 21 Id Selector  The id selector is used to specify a style for a single, unique element.  The id selector uses the id attribute of the HTML element, and is defined with a "#". #para1 { text-align:center; color:red; } sample text زبانهای برنامه سازی وب

8 Of 21 Class Selector  The class selector is used to specify a style for a group of elements.  This allows to set a particular style for many HTML elements with the same class.  The class selector uses the HTML class attribute, and is defined with a ".".center {text-align:center;} sample text1 sample text2 زبانهای برنامه سازی وب

9 Of 21 Class Selector  all p elements with class="center" will be center- aligned p.center {text-align:center;} Do NOT start a class name with a number زبانهای برنامه سازی وب

10 Of 21 CSS How To...  Three Ways to Insert CSS  External style sheet  Internal style sheet  Inline style زبانهای برنامه سازی وب

11 Of 21 External Style Sheet  Is ideal when the style is applied to many pages.  You can change the look of an entire Web site by changing one file.  Each page must link to the style sheet using the tag.  The tag goes inside the head section زبانهای برنامه سازی وب

12 Of 21 External Style Sheet  An external style sheet can be written in any text editor.  The file should not contain any html tags.  External style sheet should be saved with a.css extension.  An example: hr {color:sienna;} p {margin-left:20px;} body {background-image:url("images/back40.gif");} زبانهای برنامه سازی وب

13 Of 21 Internal Style Sheet  An internal style sheet should be used when a single document has a unique style.  Define internal styles in the head section of an HTML page, by using the tag  An example: hr {color:sienna;} p {margin-left:20px;} body {background-image:url("images/back40.gif");} زبانهای برنامه سازی وب

14 Of 21 Inline Styles  Inline style loses many of the advantages of style sheets by mixing content with presentation.  Use this method sparingly!  To use inline styles use the style attribute in the relevant tag. The style attribute can contain any CSS property.  An example: This is a paragraph. زبانهای برنامه سازی وب

15 Of 21 CSS Background  CSS properties used for background effects:  background-color: specifies the background color of an element body {background-color:#b0c4de;}  background-image: specifies an image to use as the background body {background-image:url('paper.gif');}  background-repeat: images can be repeated only horizontally or vertically, or they will look strange body {background-repeat:repeat-x; } body {background-repeat:no-repeat; }  background-position: Specifies the position of the image body {background-position:right top; } زبانهای برنامه سازی وب

16 Of 21 CSS Text  Text Color body {color:blue;} h1 {color:#00ff00;}  Text Alignment h1 {text-align:center;} p.date {text-align:right;}  Text Decoration a {text-decoration:none;} remove underlines from links h1 {text-decoration:overline;} h2 {text-decoration:line-through;} h3 {text-decoration:underline;} h4 {text-decoration:blink;}  زبانهای برنامه سازی وب

17 Of 21 CSS Text  Text Transformation  It can be used to turn everything into uppercase or lowercase letters p.uppercase {text-transform:uppercase;} p.lowercase {text-transform:lowercase;}  Text Indentation  specify the indentation of the first line of a text p {text-indent:50px;} زبانهای برنامه سازی وب

18 Of 21 CSS Font  Font Family: is set with the font property p{font-family:"Times New Roman", Times, serif;}  Font Style: is mostly used to specify italic text p.normal {font-style:normal;} p.italic {font-style:italic;}  Font Size: Sets the size of the text. h1 {font-size:40px;} زبانهای برنامه سازی وب

19 Of 21 CSS Links  Links can be styled with any CSS property (e.g. color, font- family, background, etc.).  The four links states are:  a:link - a normal, unvisited link  a:visited - a link the user has visited  a:hover - a link when the user mouses over it  a:active - a link the moment it is clicked  Example a:link {color:#FF0000; text-decoration:none;} /* unvisited link */ a:visited {color:#00FF00; background-color:#B2FF99;} /* visited link */ a:hover {color:#FF00FF;} /* mouse over link */ a:active {color:#0000FF;} /* selected link */ زبانهای برنامه سازی وب

20 Of 21 CSS Lists  The CSS list properties allow you to:  Set different list item markers for ordered lists ol.c {list-style-type: upper-roman;} ol.d {list-style-type: lower-alpha;}  Set different list item markers for unordered lists ul.a {list-style-type: circle;} ul.b {list-style-type: square;}  Set an image as the list item marker ul { list-style-image: url('sqpurple.gif'); } زبانهای برنامه سازی وب

21 Of 21 CSS Tables  Table Borders table {border: 1px solid black;}  Table Width and Height table { width:100%;} th{ height:50px; }  Table Text Alignment td{text-align:right; vertical-align:bottom;}  Table Padding td{padding:15px;}  Table Color table, td, th{border:1px solid green;} th{background-color:green;color:white;} زبانهای برنامه سازی وب