Chapter 2 - HTML
Chapter 2 - HTML
COLLEGE OF COMPUTING
DEPARTMENT OF
COMPUTER SCIENCE
Internet Programing
By Seiyfu Yesuf1
<html>
<!-- comment Internet Programing 2019-->
<table>…</table> specify a table
<head>
<title>Tables</title> element
</head>
<html>
When we load test.htm file, it produces
<body bgcolor = "#b5dcb3"> following result
<h3>This is main page and
content from any link will be
displayed here.</h3>
<p>So now click any link and see
the result.</p>
</body>
</html>
The following short style sheet, sets the text color of a paragraph to
green and surrounds it with a solid red border:
P.special {
color : green;
border: solid red;
}
Authors may link this style sheet to their source HTML document with the LINK
element:
<LINK href="special.css" rel="stylesheet" type="text/css">
ASU/Computing/Computer Scienc Internet Programing 44
Style Sheet Rules:- CSS has a simple syntax and uses a number of
English keywords to specify the names of various style properties.
A style sheet consists of a list of rules. Each rule or rule-set consists of
one or more selectors, and a declaration block.
CSS selectors:- Selectors declare which part of the markup a style
applies to by matching tags and attributes in the markup itself.
Selectors may apply to the following:
- all elements of a specific type, e.g. the second-level
headers h2
elements specified by attribute, in particular:
id: an identifier unique within the document
class: an identifier that can annotate multiple elements in a
document
ASU/Computing/Computer Scienc Internet Programing 45
You can use CSS in three ways in your HTML document
External Style Sheet − Define style sheet rules in a separate .css file
and then include that file in your HTML document using HTML <link>
tag.
Internal Style Sheet − Define style sheet rules in header section of
the HTML document using <style> tag.
Inline Style Sheet − Define style sheet rules directly along-with the
HTML elements usingstyle attribute.