Web programming top tips
Here are my handy hints for web programming. I'm covering some major parts issues that a non-web developer (well I've been developing websites properly since July but I wouldn't call myself at all skilled with it yet, plus I really hate it compared with VB.NET and C#) like myself might have.
- A page is started by giving it some information. A
<!doctype html>defines it as pure HTML5.
- Pages consist of a head that is written as
and a body displayed as
- A page must have a title, which is stored in the attribute like so
- Image element is specified by the
<img>tag. Alt is required in HTML5.
- Paragraphs are represented by the
<p>tag where the content goes in the middle.
- Lists are represented as
<ol></ol>for ordered (numbered) lists and
<ul></ul>for unordered (bulleted) lists
- A list item is represented as
- HTML consists of what are known as entities. These are used because these symbols are used elsewhere in the HTML specification but in some cases just because of the character code variation across operating systems. Some examples include:
- £ = £
- ¢ = ¢
- Breaks are represented as
. This creates a line break.
- Links follow an easy to use structure
<a href="link.html">Link here</a>
- You can include images inside hrefs or many other DOM objects.
- The div element is an empty divider or divison. Divisons can contain elements within them.
- An element can be given reference to a CSS class or identifier using class and id.
<link rel="stylesheet" href="style.css">defines a link to a CSS file
- CSS stands for Cascading Stylesheets and is used to style the HTML pages.
- An inline object flows with the text
- A block element will block everything on the left and right and sits on a line on it's own.
- To deploy two elements next to each other, use the
width:50%property and value combinations
colordefines the fore colour of an element whereas
backgrounddefines the background colour.
.nameis a class identifier whereas
#nameis a unique id identifier. Tag selection is achieved with the name of the tag, e.g.
- There are three kinds of CSS, inline (
style=""), internal (
<style></style>) and external (