CSS Basic (cascading style sheets)

Slides:



Advertisements
Similar presentations
Intro to HTML. HTML HTML = HyperText Markup Language Used to define the content of a webpage HTML is made up of tags and attributes Content.
Advertisements

Introduction to HTML & CSS
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.
Cascade Style Sheet Demo ISYS 350. Cascading Style Sheets Cascading Style Sheets (CSS) is a mechanism for adding style (e.g., fonts, colors, spacing)
Ideas to Layout Beginning web layout using Cascading Style Sheets (CSS). Basic ideas, practices, tools and resources for designing a tableless web site.
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
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
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. 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.
1 Creating Web Pages Part 3. 2 CASCADING STYLE SHEETS (CSS): What exactly are they? Set of rules that define how a web browser should display an HTML.
4.01 Cascading Style Sheets
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.
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,
Basics of HTML.
IT Introduction to Website Development Welcome!
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
STYLING THE WEBSITE - EXTERNAL CSS BY JORGE MARTINEZ.
 ult.htm ult.htm  This website illustrates the use of CCS (style sheets)
CSS Style Rules Guang Tong, Zhan L;lo’p[ Css Style Rule Guang Tong Zhan Three ways to insert CSS 1 External style sheet 2 Internal style sheet 3 Inline.
The Characteristics of CSS
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
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.
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.
Cascade Style Sheet Demo ISYS 350. Cascading Style Sheets Cascading Style Sheets (CSS) is a mechanism for adding style (e.g., fonts, colors, spacing)
Cascading Style Sheets (CSS)
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.
CSS CSS is short for C ascading S tyle S heets. It is a new web page layout method that has been added to HTML to give web developers more control over.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
Essentials of HTML Class 4 Instructor: Jeanne Hart
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
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.
 Look especially at › File Tips and Shortcuts › Student video.
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.
Introduction To CSS by: Alexandra Vlachakis Sandy Creek High School, Fayette County Schools Content and Resources Used With Permission: Interact With Web.
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 
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
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.
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.
Cascading Style Sheets Using HTML. What are they? A set of style rules that tell the web browser how to present a web page or document. In earlier versions.
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.
Introduction To CSS. Lesson 1: History of CSS CSS was proposed in 1994 as a web styling language. To helps solve some of the problems HTML 4. There were.
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.
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.
Cascading Style Sheet.
4.01 Cascading Style Sheets
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
CSS Cascading Style Sheets
Website Design 3
Cascading Style Sheets - Building a stylesheet
محمد احمدی نیا CSS محمد احمدی نیا
What are Cascading Stylesheets (CSS)?
Cascading Style Sheets - Building a stylesheet
4.01 Cascading Style Sheets
Presentation transcript:

CSS Basic (cascading style sheets) Here we study about … Introduction Syntax ID and Class Some basic Programming CSS Examples CSS Quiz

Introduction Q. What is CSS Stands for? or What is full form of CSS? Ans. CSS stands for ”Cascading Style Sheets”. Q. How CSS more beneficial in human life? or How it is useful in creating a Site? Ans. We can display HTML elements more attractive and mannered with the help of CSS. Styles were added to HTML 4.0 to solve a problem. we can manage all the pages from one the file. All browser support CSS in today’s life. Specially HTML 4.0 keeps all formatting in one single file with extension CSS and all formatting could be removed from HTML 4.0 documents and stores in one single file with extension CSS.

feature Q. Is CSS reliable? or Is CSS saved time in creating and editing a web site? Ans. Yes, it reliable and saved a time in creating and editing a web site. Just we will make changes in single .css file and all the pages will changed. Q. How many ways we can insert Style sheet? Ans. There are three ways of inserting a style sheet: 1. External style sheet 2. Internal style sheet 3. Inline style

External style sheet Q. What is External style sheet? Ans. An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the HTML head section. Q. Write down the commands to link external style sheet? Ans.<head> <link rel="stylesheet" type="text/css“ href="mystyle.css" /> </head>

External style sheet Q. Can we use any text editor for creating .css file? Ans. Yes, we can use any text editor for creating .css file and Your style sheet should be saved with a .css extension. Q. Can we use HTML tags in style sheet file? Ans. No, The file should not contain any html tags. Q. Give the simple example of Style sheet? Ans. hr {color:sienna;} p {margin-left:20px;} body {background-image:url("images/back40.gif");}

Internal Style Sheet Q. What is Internal style sheet? Ans. An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, by using the <style> tag. Q. Write down the commands for Internal style sheet? Ans. <head> <style type="text/css"> hr {color:sienna;} p {margin-left:20px;} body {background-image:url("images/back40.gif");} </style> </head>

Inline Styles Q. What is Inline style sheet? Ans. An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly. To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. Q. Write down the commands for Inline style sheet? Ans. <p style="color:sienna;margin-left:20px">This is a paragraph.</p>

CSS syntax Q. What is the CSS basic rules? Ans. The basic rules of CSS having two main parts. Selector and one and more Declaration A selector normally a HTML element that 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. Example … Selector Declaration 1, Declaration 2 h1 { color:blue; font-size:12px; } Property Value Property Value

CSS syntax (tips) Tips (1):- A CSS declaration always ends with a semicolon, and declaration groups are surrounded by curly brackets. p {color:red;text-align:center;} Tips (2):- To make the CSS more readable, you can put one declaration on each line, like this. p { color:red; text-align:center; } Where p is the HTML tag. (<p>)

CSS syntax (tips) Tips (3) :- 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 begins with "/*", and ends with "*/", like this. /*This is a comment*/ p { text-align:center; /*This is another comment*/ color:black; font-family:arial; }

CSS Id and Class Q. What is Id and Class in CSS? Ans. In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called "id" and "class". Q. Why we Id Selector in CSS? Ans. The id selector is used to specify a style for a single, unique element. Q. How to define Id selector in a Program? Ans. The id selector uses the id attribute of the HTML element, and is defined with a "#".

Id Selector Example <html> <head> <style type="text/css"> #para1 { text-align:center; color:red; } </style> </head> <body> <p id="para1">Hello World!</p> <p>This paragraph is not affected by the style.</p> </body> </html> Notes: do not start the name of Id with number, it’s will not work with Mozzila/Firefox.

The class Selector Q. Why to use Class Selector in CSS? Ans. The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements. This allows you 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 ".“ Notes:- do not start a class name with a number! This is only supported in Internet Explorer.

The Class Selector (Example) <html> <head> <style type="text/css"> .center { text-align:center; } </style> </head> <body> <h1 class="center">Center-aligned heading</h1> <p class="center">Center-aligned paragraph.</p> </body> </html> Notes:- In the example above, all HTML elements with class="center" will be center-aligned:

The Class Selector (Example) Example:- <html> <head> <style type="text/css"> p.center { text-align:center; } </style> </head> <body> <h1 class="center">This heading will not be affected</h1> <p class="center">This paragraph will be center-aligned.</p> </body> </html> Notes:- You can also specify that only specific HTML elements should be affected by a class. In the example above, all p elements with class="center" will be center-aligned:

Try to do in CSS Try to do so … CSS Backgrounds CSS Text CSS Fonts CSS Links CSS Lists CSS tables CSS Box Model CSS Border CSS Outline CSS Margin CSS Padding CSS Grouping and Nesting CSS Dimension CSS Display CSS Positioning CSS Floating CSS Image gallery CSS Attribute Selector