You are on page 1of 1

HTML Links

HTML links are defined with the <a> tag: <a href="http://www.w3schools.com">Thi
s is a link</a>
++++++++++++
HTML Images
HTML images are defined with the <img> tag.
The source file (src), alternative text (alt), and size (width and height) are p
rovided as attributes:
<img src="w3schools.jpg" alt="W3Schools.com" width="104" height="142">
+++++++++++++
The CSS Box Model
Every visible HTML element has a box around it, even if you cannot see it.
The CSS border property defines a visible border around an HTML element:
Example
p {
border:1px solid black;
}
The CSS padding property defines a padding (space) inside the border:
Example
p {
border:1px solid black;
padding:10px;
}
The CSS margin property defines a margin (space) outside the border:
Example
p {
border:1px solid black;
padding:10px;
margin:30px;
}
The class Attribute
To define a style for a special type (class) of elements, add a class attribute
to the element:
Example
<p class="error">I am different</p>
Now you can define a different style for this type (class) of element:
Example
p.error {
color:red;
}
<link> Defines a link between a document and an external resource

You might also like