CourseLecture1,2 Introduction
CourseLecture1,2 Introduction
Correct:
A break: <br />
A horizontal rule: <hr />
An image: <img src="happy.gif" alt="Happy face" />
Wrong:
A break: <br>
A horizontal rule: <hr>
An image: <img src="happy.gif" alt="Happy face">
Example of XHTML documents
XHTML Elements Must be in Lowercase
Correct:
<body>
<p>This is a paragraph</p>
</body>
Wrong:
<BODY>
<P>This is a paragraph</P>
</BODY>
Example of XHTML documents
XHTML Attribute Names Must be in Lowercase
Correct:
<a href="https://www. xhtmlweb.com/html/">Visit our page</a>
Wrong:
<a HREF="https://www.xhtmlweb.com/html/">Visit our Page</a>
Correct:
<a href="https://www.w3schools.com/html/"> Visit our Page </a>
Wrong:
<a href=https://www.w3schools.com/html/> Visit our Page </a>
Example of XHTML documents
XHTML Attribute Minimization is Forbidden
Correct:
<input type="checkbox" name="vehicle" value="car" checked="checked" />
<input type="text" name="lastname" disabled="disabled" />
Wrong:
<input type="checkbox" name="vehicle" value="car" checked />
<input type="text" name="lastname" disabled />
What is CSS?
• CSS stands for Cascading Style Sheets.
• It is a style sheet language which is used to describe the look
and formatting of a document written in markup language.
• It is generally used with HTML to change the style of web
pages and user interfaces.
• CSS is used along with HTML and JavaScript in most websites
to create user interfaces for web applications and user
interfaces for many mobile applications.
CSS Syntax
A CSS rule set contains a selector and a declaration block.
CSS Syntax
Selector: Selector indicates the HTML element you want to style.
It could be any tag like <h1>, <title> etc.
Declaration Block: The declaration block can contain one or more
declarations separated by a semicolon. For the above example,
there are two declarations:
1.color: yellow;
2.font-size: 11 px;
Each declaration contains a property name and value, separated
by a colon.
Property: A Property is a type of attribute of HTML element. It
could be color, border etc.
Value: Values are assigned to CSS properties. In the above
example, value "yellow" is assigned to color property.
CSS Example:
INLINE CSS
An inline CSS is used to apply a unique style to a single HTML
element.
<h1 style="color:blue;">A Blue Heading</h1>
OUTPUT:
CSS Example:
Internal CSS
An internal CSS is used to define a style for a single HTML page.
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: powderblue;}
h1 {color: blue;}
p {color: red;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
CSS Example:
External CSS
An external style sheet is used to define the style for many HTML
pages.
To use an external style sheet, add a link to it in the <head>
section of each html page.
Thank
You