WebD Introduction to CSS By Manik Rastogi.

Slides:



Advertisements
Similar presentations
HTML and CSS. HTML Hyper Text Markup Language Tells browser how to display text and images.
Advertisements

CSS Styling CSS Box Model & CS110: Computer Science and the Internet.
Web Engineering 1 Ishaq Khan Shinwari MCS City University Peshawar.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Today CSS HTML A project.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Very quick intro HTML and CSS. Sample html A Web Title.
Cascading Style Sheets (CSS): Pixel-Level Control with HTML Ease
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.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
Cascading Style Sheet CSS CS1520 Ali Alanjawi. 2 TA Information Ali Alanjawi Homepage: Office:
CSS(Cascading Style Sheets )
Part 3 Introduction to CSS. CSS Text Text Styles h1 {color: green} // rgb(0,255,0), #00ff00 h2{letter-spacing: 0.5cm} // 2px h3 {text-align: right} //
กระบวนวิชา 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.
Unit 20 - Client Side Customisation of Web Pages
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.
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.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
1 CSS محمد احمدی نیا 2 Of 21 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements 
1 Cascading Style Sheets
CSS.
Cascading Style Sheet.
CS3220 Web and Internet Programming CSS Basics
CSS: Cascading Style Sheets
4.01 Cascading Style Sheets
( Cascading style sheet )
Semester - Review.
Unit 3 - Review.
Creating Your Own Webpage
UNIT-II CSS.
Cascading Style Sheet List Properties Box Properties Pseudoclass
Introduction to the Internet
CSS Box Model <span> & <div>
Cascading Style Sheets
Cascading Style Sheets (Formatting)
Cascading Style Sheets (Layout)
Cascading Style Sheet (CSS)
Web Development & Design Foundations with HTML5 7th Edition
Chapter 7 Page Layout Basics Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with HTML5
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Cascading Style Sheet List Properties Box Properties Pseudoclass
Website Design 3
Basics of Web Design Chapter 7 Page Layout Basics Key Concepts
Introduction to Web programming
The Internet 10/13/11 The Box Model
CSS Borders and Margins.
Cascading Style Sheets
CSS Style Sheets: Intro
محمد احمدی نیا CSS محمد احمدی نیا
List Properties Box Properties Pseudoclass
What are Cascading Stylesheets (CSS)?
Web Development & Design Foundations with HTML5
How to use the CSS box model for spacing, borders, and backgrounds
CS3220 Web and Internet Programming CSS Basics
CS3220 Web and Internet Programming CSS Basics
Cascading Style sheet. What is CSS?  CSS stands for Cascading Style Sheets  Cascading: refers to the procedure that determines which style will apply.
Web Development & Design Foundations with HTML5
Cascading Style Sheets
4.01 Cascading Style Sheets
Web Client Side Technologies Raneem Qaddoura
Introduction to Cascading Style Sheets (CSS)
Introduction to Styling
Cascading Style Sheets
Cascading Style Sheets™ (CSS)
Presentation transcript:

WebD Introduction to CSS By Manik Rastogi

What is CSS? *CSS stands for Cascading Style Sheets *CSS defines how HTML elements are to be displayed *CSS defines Style of a web page.

CSS Syntax selector{ property : value ; } Div{ width : 100px; } Selector : Selects the element on which properties will be applied. Declaration : Properties to be applied. Property : what property you want to style. Value : Value of the property. selector{ property : value ; } Div{ width : 100px; }

CSS Comments Comments are used to explain your code, and may help you when you edit the source code at a later date. Comments are ignored by browsers. A CSS comment starts with /* and ends with */. Comments can be of multiple lines. . p { color: red;      /* This is a comment */     text-align: center; }

CSS Selectors CSS selectors are used to select HTML elements based on their id, class, type, attribute, and more. Element selector selects elements based on the element name. p { text-align: center; } : It selects all <p> elements in html. Id selector selects elements based on the id attributes. #id1 { text-align: center; } : It selects all elements in html where id=“id1”.

CSS Selectors Class selector selects elements based on the class attributes. .class1 { text-align: center; } : It selects all elements in html where class=“class1”. Group selector selects more than element based on the given attributes. P , #id1 , .class1 { text-align: center; } : It selects all elements in html where class=“class1” , id=“id1” and all <p> tags.

Inserting CSS External Style Sheet There are three ways of inserting a style sheet: External style sheet Internal style sheet Inline style External Style Sheet <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head>

Inserting CSS Internal Style Sheet Inline Style Sheet <style> /* CSS Goes here */ </style> Inline Style Sheet <p style=“ /* CSS Goes here */ “>Content</p>

CSS Background Background Color : background-color: ff0000 | red; Background Image : background-image : url(‘image.jpg’) ; Background Properties : background-repeat : no-repeat | repeat-x; background-position : right top;

CSS Text Text Color : color: ff0000 | red; Text Alignment: text-align : center | left | right; Text Decoration: text-decoration : underline | overline | line-through; Text Transformation : text-transform : lowercase | uppercase ;

CSS Font Font : font-family : serif | sans-serif ; font-family : Times new Roman | Arial ; Font Style: font-style : italic | normal ; Font Size: font-size : 16px | 1.5em ; 1em = Current Browser Size i.e. if browser font size is set to 16 px then 2em = 2x16 = 32px

CSS Links Link : a:link { color : #FF0000 | red ; Link Visited : background-color: #00FF00 | Blue; } Link Visited : a:visited { color : #FF0000 | red ; } Link On Mouse Over : a:hover { color : #FF0000 | red ; }

CSS Lists List Item Markers : list-style-type circle | square | upper-roman | lower-alpha; List Item Marker image : list-style-image: url(‘image.png’) ; Other Properties ul li { color : #FF0000 | red ; background-color : #00FF00 | Blue; }

Div Box Model

Div Box Model Applying CSS on Div : div { width: 320px; padding: 10px; border: 5px solid gray; margin: 0;  } Total Width of Div : 320px (width) + 20px (left + right padding) + 10px (left + right border) + 0px (left + right margin) = 350px

CSS Border Border Style : border-style : solid | dotted | dashed | double ; Border Width : border-width : 5px | medium ; Border Color : border-color : red | #98bf21 ; Border Individual Sides : border-top-style : solid; | border-right-style : dotted;

CSS Margin Margin : margin : 10px | auto | 10% ; Margin Individual Sides : margin-top : 100px; margin-left : 100px; margin-bottom: 50px; margin-right : 150px;

CSS Padding Padding : padding : 10px | 10% ; Padding Individual Sides : padding-top : 100px; padding-left : 100px; padding-bottom: 50px; padding-right : 150px;

CSS Positioning Static Positioning : position : static; Fixed Positioning : { position : fixed ; top : 30px ; left : 5px; } Relative Positioning: { position : relative; left : 20px; }

CSS Navigation Bar Project for you guys. Design Horizontal Navigation Bar. Use Background color : #31E419 and Text Color : white Use Font : Sans-serif & Bold Text. Instruction : Use UL List of none style. Use Display : inline property to align list in Horizontal manner. Style the Navigation Bar.