To use this website fully, you first need to accept the use of cookies. By agreeing to the use of cookies you consent to the use of functional cookies. For more information read this page.

Web programming top tips

21 Oct 2013 at 18:10
Here are my top tips for web programming using HTML, PHP, CSS and MySQL.

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.

HTML

  • 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 <head></head><body></body>
  • A page must have a title, which is stored in the attribute like so <title>Page</title>
  • 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 <li></li>
  • Text
  • 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:
    • &pound; = £
    • &cent; = ¢
  • 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.
  • An id can be given to an arbitrary div so that it can be accessed later such as through JavaScript. For example, #home need not exist in the CSS as a selector, but it can be used uniquely by jQuery and JavaScript.
  • <link rel="stylesheet" href="style.css"> defines a link to a CSS file

CSS

  • 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 float:left and width:50% property and value combinations
  • color defines the fore colour of an element whereas background defines the background colour.
  • .name is a class identifier whereas #name is a unique id identifier. Tag selection is achieved with the name of the tag, e.g. p
  • There are three kinds of CSS, inline (style=""), internal (<style></style>) and external (<link rel="stylesheet">)
web
programming
top
tips