This document provides information about HTML elements and CSS properties. It discusses the different DOCTYPE declarations for HTML, XHTML, and HTML5. It also covers using ID and class attributes, headings, tables, and div elements. The document compares tables and div elements and provides tips for using tables. Finally, it defines margin, padding, transparency and ends with a cross-browser transparency example.
2. HTML DOCTYPE?
HTML DOCTYPE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
XHTML DOCTYPE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
HTML5 DOCTYPE
<!DOCTYPE html>
5. attr id
Attribute id
<div id="elem_id"></div>
Identity of HTML Element
●
●
It is the only
Always use in JavaScript
6. attr class
Attribute class
<div class="text-layer bg-red"></div>
Styling the HTML Element
●
●
It can be many
Each class match with their css in stylesheet
.text-layer {
font-family: Monaco, "Courier New", monospace;
font-size: 12px;
cursor: text;
}
.bg-red {
background-color: red;
}
11. <table> VS <div>
Tips for using <table>
●
●
When the container has margin or padding, do not set table in 100% width
Do not try to set the height, if you want to make it flexible
padding
<table width=”100%”>
padding
<table width=”auto”>