Introduction to Web programming

Slides:



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

Intro To Cascading Style Sheets By Mario Yannakakis.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Cascading Style Sheets
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
Today CSS HTML A project.
Introduction to CSS. What is CSS? A CSS (cascading style sheet) file allows you to separate your web sites (X)HTML content from it’s style. Use your (X)HTML.
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.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
“Cascading Style Sheets” for styling WWW information DSC340 Mike Pangburn.
กระบวนวิชา 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.
Cascading Style Sheet (CSS) Instructor: Dr. Fang (Daisy) Tang
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
CSS Hadas Kahsay. Overview  What is CSS  Basic syntax of CSS Rules  How to link CSS style to html documents  Browsers and CSS  Advantages of CSS.
Designing Web Pages The case for CSS. The Power of CSS css Zen Garden
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 Cascading Style Sheets. Session Checklist ► Learn why style sheets are needed and their advantages and disadvantages ► Learn the format of a style.
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.
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.
HTML WITH CSS.
Web Development & Design Foundations with XHTML
Getting Started with CSS
Introduction to Web programming
CS3220 Web and Internet Programming CSS Basics
4.01 Cascading Style Sheets
An Introduction to Cascading Style Sheets
HTML WITH CSS.
Creating Your Own Webpage
>> Introduction to CSS
Introduction to CSS.
Introduction to the Internet
Madam Hazwani binti Rahmat
>> CSS Rules Selection
CX Introduction to Web Programming
Cascading Style Sheets (CSS)
Cascading Style Sheet (CSS)
Cascading Style Sheets
CASCADING STYLE SHEET CSS.
Filezilla problems continuing
Cascading Style Sheets - Building a stylesheet
Introduction to CSS.
Introduction to Web programming
CSS.
DynamicHTML Cascading Style Sheet Internet Technology.
Stylin’ with CSS.
Web Programming– UFCFB Lecture 11
What are Cascading Stylesheets (CSS)?
The Internet 10/6/11 Cascading Style Sheets
Cascading Style Sheets
DynamicHTML Cascading Style Sheet Internet Technology.
Tutorial 3 Working with Cascading Style Sheets
CS3220 Web and Internet Programming CSS Basics
CSS.
Introduction to CSS.
CS3220 Web and Internet Programming CSS Basics
Made By : Lavish Chauhan & Abhay Verma
Cascading Style Sheets - Building a stylesheet
Stylin’ with CSS.
4.01 Cascading Style Sheets
External Style Sheets.
Web Client Side Technologies Raneem Qaddoura
Stylin’ with CSS.
Cascading Style Sheets III B. Com (Paper - VI) & III B
Web Programming and Design
INTERNATIONAL INSTITUTE OF IFORMATION TECHNOLOGY, (I²IT)
Presentation transcript:

Introduction to Web programming 0731213

Lecture 1 Styling HTML with CSS

Styling HTML with CSS CSS stands for Cascading Style Sheets. CSS describes how HTML elements are to be displayed on screen, paper, or in other media. CSS saves a lot of work. It can control the layout of multiple web pages all at once. The most common way to add CSS, is to keep the styles in separate CSS files

CSS Advantages Makes website more flexible CSS is reusable Change stylesheet to change design of many pages Example: CSS Zen garden http://www.csszengarden.com/ Easier to maintain Cleaner HTML code Separates styles from HTML tags and page content Consistent look across entire website that is easily maintained by changing styles in one place.

CSS Disadvantages For this course we use Chrome Not uniformly supported by all browsers. CSS works differently on different browsers. IE and Opera supports CSS as different logic. Chrome adheres to CSS standards more than IE For this course we use Chrome

adding style There are two aspects to adding style to a Web page via CSS Specifying what the style looks like “Declaration” Naming the HTML element “Selector” selector { property: value; ... } CSS A CSS Selector A CSS declaration p { font-family: sans-serif; color: red; } CSS

Naming HTML elements There are two naming options for an HTML element: assigning “ID” names and “class names.” An id declaration is the same as a class declaration, except that it should only be used specifically once per Web page <h1 class=”myboldandbluelook”> Introduction </h1> .myboldandbluelook { font-weight: bold; color: blue; } <h1 id=”myboldandbluelook”> Introduction </h1> #myboldandbluelook { font-weight: bold; color: blue; }

Attaching a CSS file <link> <head> ... <link href="filename" type="text/css" rel="stylesheet" /> </head> HTML <link href="style.css" type="text/css" rel="stylesheet" /> <link href="http://www.google.com/uds/css/gsearch.css" rel="stylesheet" type="text/css" /> HTML A page can link to multiple style sheet files In case of a conflict (two sheets define a style for the same HTML element), the latter sheet's properties will be used

CSS properties for colors color: red; background-color: yellow; } CSS This paragraph uses the style above output property description color color of the element's text background-color color that will appear behind the element

Lecture 2 CSS properties

CSS properties CSS properties for colors. More details CSS properties for Backgrounds. More details CSS properties for Borders. More details CSS properties for Margins. More details CSS properties for padding. More details CSS properties for text. More details CSS properties for fonts. More details CSS properties for links. More details CSS properties for float and clear. More details CSS properties for align. More details and even more

Body styles body { font-size: 16px; } CSS Applies a style to the entire body of your page Saves you from manually applying a style to each element

CSS comments /*…*/ /* This is a comment. It can span many lines in the CSS file. */ p { color: red; background-color: aqua; } CSS The // single-line comment style is NOT supported in CSS The <!-- ... --> HTML comment style is also NOT supported in CSS

Grouping styles This h2 uses the above styles. p, h1, h2 { color: green; } h2 { background-color: yellow; } CSS This paragraph uses the above style. output This h2 uses the above styles. A style can select multiple elements separated by commas The individual elements can also have their own styles

Descendant (nested) selector Syntax is similar to the example of grouping selectors—but without the commas Selects all elements that correspond to the “nested” structure specified by the selector E.g., the above style will apply to any <strong> HTML tag that lies within an <a> tag that lies within an <li> tag that lies within a <ul> tag ul li a strong{color:green;} CSS

CSS Example Example.html style.css <!DOCTYPE html> <html> <head> <link href=“style.css" type="text/css" rel="stylesheet" /> </head> <body> <h1>My First CSS Example</h1> <p>This is a paragraph.</p> </body> </html> HTML body { background-color: lightblue; } h1 { color: white; text-align: center; p { font-family: verdana; font-size: 20px; } CSS

References https://www.w3schools.com/ Robin Nixon, Learning PHP, MySQL, JavaScript, and CSS, 2013 Mike McGrath, PHP & My SQL in easy steps, 2012.

The End