Working with Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 5.
Basics of HTML and CSS for web programming Part 1
-
Upload
ajit-dadresa -
Category
Technology
-
view
310 -
download
2
description
Transcript of Basics of HTML and CSS for web programming Part 1
iFour Consultancy
Basics of HTML and CSS and Web Programming
Introduction To HTML
What Is HTML?
• HTML is markup language for describing web pages.• HTML stands for Hyper Text Markup Language.• A markup language is a set of markup tags.• HTML documents are described by HTML tags.• Each HTML tag describes different document content.
•A markup language is a set of markup tags •A markup language is a set of markup tags
http://www.ifour-consultancy.com
ASP.NET Software company India
HTML tags
HTML tags are keywords surrounded by angle brackets.HTML tags normally come in pairs like <p> and </p>.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, but with a slash before the tag name.
http://www.ifour-consultancy.com
ASP.NET Software company India
HTML documents
All HTML documents must start with a type declaration: <!DOCTYPE html>. The HTML document itself begins with <html> and ends with </html>. The visible part of the HTML document is between <body> and </body>. HTML headings are defined with the <h1> to <h6> tags. HTML paragraphs are defined with the <p> tag. HTML links are defined with the <a> tag. The link address is specified in the href attribute. HTML images are defined with the <img> tag. The source file (src), alternative text (alt), and size (width and height) are
provided as attributes.
http://www.ifour-consultancy.com
ASP.NET Software company India
HTML Attributes
HTML elements can have attributes. Attributes provide additional information about an element. Attributes are always specified in the start tag. Attributes come in name/value pairs like: name="value”. The Document Language can be declared in the <html> using lang attribute. HTML paragraphs are defined with the <p> tag.
http://www.ifour-consultancy.com
ASP.NET Software company India
What is CSS?• CSS stands for Cascading Style Sheets.• Styles define how to display HTML elements.• External Style Sheets can save a lot of work.• External Style Sheets are stored in CSS files.
Introduction to CSS
http://www.ifour-consultancy.com
ASP.NET Software company India
A CSS rule set consists of a selector and a declaration block. The selector points to the HTML element you want to style. The declaration block contains one or more declarations separated by
semicolons. Each declaration includes a property name and a value, separated by a colon. A CSS declaration always ends with a semicolon, and declaration groups are
surrounded by curly braces. CSS selectors are used to "find" (or select) HTML elements based on their id,
classes, types, attributes, values of attributes and much more.
CSS Syntax
http://www.ifour-consultancy.com
ASP.NET Software company India
There are three ways of inserting a style sheet:• Internal Style Sheet.• External Style Sheet. • Inline Style Sheet.
Three Ways to Insert CSS
http://www.ifour-consultancy.com
ASP.NET Software company India
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 just one file. Each page must include a link to the style sheet with the <link> tag. The
<link> tag goes inside the head section. An external style sheet can be written in any text editor. The style sheet file must be saved with a .css extension.
External Style Sheet
http://www.ifour-consultancy.com
ASP.NET Software company India
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, inside the <style> tag. An internal style sheet can be used to define a common style for all HTML elements
on a page.
Internal Style Sheet
http://www.ifour-consultancy.com
ASP.NET Software company India
To use inline styles, add the style attribute to the relevant tag. The style attribute can contain any CSS property. Inline styling is useful for applying a unique style to a single HTML element. Inline styling uses the style attribute.
Inline Style Sheet
http://www.ifour-consultancy.com
ASP.NET Software company India
CSS Background
The background-color property specifies the background color of an element. The background color of a page is defined in the body selector. The background-image property specifies an image to use as the background of an
element. By default, the image is repeated so it covers the entire element.
http://www.ifour-consultancy.com
ASP.NET Software company India
The CSS style font-family defines the font to be used for in HTML element. The CSS style font-size defines the text size to be used for in HTML element. The CSS style color defines the text color to be used for in HTML element.
CSS Fonts
http://www.ifour-consultancy.com
ASP.NET Software company India