Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to HTML & CSS. What is HTML Hyper Text Markup Language It is a markup language used to create the content and semantic structure of Web pages.

Similar presentations


Presentation on theme: "Introduction to HTML & CSS. What is HTML Hyper Text Markup Language It is a markup language used to create the content and semantic structure of Web pages."— Presentation transcript:

1 Introduction to HTML & CSS

2 What is HTML Hyper Text Markup Language It is a markup language used to create the content and semantic structure of Web pages. A Web page is comprised of a number of HTML elements, each of which has a particular meaning in the context of a Web page.

3 Web Browsers The purpose of a web browser (Chrome, Internet Explorer, Firefox) is to read HTML documents and display them as web pages. The browser does not display the HTML tags, but uses these tags to interpret the content of the page.

4

5 HTML Tags HTML tags are keywords (tag names) surrounded by angle brackets like HTML tags normally come in pairs like and The first tag in a pair is the start tag, the second tag is the end tag The end tag is written like the start tag, with a forward slash before the tag name

6 HTML Elements An HTML element is everything between the start tag and the end tag, including the tags: HTML Element: This is a heading

7 Element Attributes HTML elements can have attributes, which provide additional information/usage Attributes are always specified in the start tag Attributes come in name/value pairs Eg:

8 Essential tags

9 Basic Structure of a HTML document Page title ****Content comes here****

10 Deprecated Tags and Attributes In HTML 4, several deprecated tags and attributes were used to style documents. These tags are not supported in HTML 5. Avoid using the elements,, and and the attribute bgcolor.

11 Some important tags to -Headings - Paragraphs Anchor tag – links – adding images -adding divisions, basically used for layout and with CSS - checkboxes, text-area, submit buttons, radio,etc. - creating a HTML form Note that the and do not have closing tags

12 Some important tags creates a table - table row - table cell - break line - horizontal line

13 CSS Cascading Style Sheets Styles define how to display HTML elements. CSS was introduced together with HTML 4, to provide a better way to style HTML elements.

14 Types of style sheets Browser style sheets (default ) User style sheets Author style sheetsInlineInternalExternal

15 Adding CSS to HTML CSS can be added to HTML in the following ways: 1.Inline - using the style attribute in HTML elements 2.Internal - using the element in the section 3.External - using an external CSS file The preferred way to add CSS to HTML, is to put CSS syntax in external CSS files.

16 Inline Styles An inline style can be used if a unique style is to be applied to one single occurrence of an element. To use inline styles, use the style attribute in the relevant tag. The style attribute can contain any CSS property.

17 Internal Style Sheets An internal style sheet can be used if one single document has a unique style. Internal styles are defined in the section of an HTML page, by using the tag

18 External style sheets External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file! Saved in.css extension Each page must link to the style sheet using the tag:

19 Style priority 1.Inline style 2.Internal style sheet 3.External style sheet Decreasing Priority !important – used with a style attributes to override other style attributes assigned to an element

20 CSS Syntax h1 {color:#09C;font-family:Helvetica;} SelectorPropertyValuePropertyValue

21 CSS Selectors They allow authors to target specific HTML elements so that they can be styled.

22 Type selector The type selector is written using the element type only. A type selector selects every instance of the element type regardless of their position in the document tree.

23 ID & Class In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called "id" and "class". The id selector is used to specify a style for a single, unique element. The class selector is used to specify a style for a group of elements.

24 ID Selectors The id selector is written using a “#” followed by the id value. Note: Class values are case-sensitive. Browsers will interpret “a” and “A” differently.

25 Class Selectors The class selector is written using a “.” followed by the class value. Note: Class values are case-sensitive. Browsers will interpret “a” and “A” differently.

26 Class Selectors You can also combine type and class selectors to isolate specific instances of an element. For example: This means that only paragraphs with a class of “big” will be selected.


Download ppt "Introduction to HTML & CSS. What is HTML Hyper Text Markup Language It is a markup language used to create the content and semantic structure of Web pages."

Similar presentations


Ads by Google