Tuesday, 26 April 2011

CSS Trickery



It can be frustrating making your website work properly in all browsers, especially when you use little CSS tricks. These are some of the tricks I use which usually work in most browsers.

Central Floating Column Website

This is a common layout used for websites and is usually achieved by wrapping the website content in a div with a declared width and automatic margin.

.wrapper{
width:80%;
margin:0 auto;
}

note: width can be either % or pixels (px), the example uses shorthand margin (margin: top right bottom left).

However this technique is not supported in IE. The text-align property of the html/body tag needs to be set to center, the text-align for the website content can then be set back to left in the wrapper class.

CSS becomes:

html, body{
text-align:center;
}
.wrapper{
text-align:left;
width:80%;
margin:0 auto;
}

Div Height

Some say the height of a div cannot be set as a percentage, others say it can only be achieved by setting the size of a hidden image in the div, both are wrong.

A div's height is relevant to it's parent and so to set a div's height, the height of the parent ie. body must be declared. For example:

html, body{
width:100%;
height:100%;
}

.content{
width:100%;
height:100%;
}

Floats

Floats are often misunderstood. They do not float to the side of the content, the content floats around them. As well as declaring the floated element, the point at which to stop floating content around it needs to be declared using the 'clear' property. I usually use preset classes for the floats and clear so they can be easily implemented.

.fltlft{
float:left;
}
.fltrt{
float:right;
}
.clear{
clear:both;
}

Hover

CSS Psuedo-class ':hover' is usually used as part of anchor tags for links, however they can be used on almost any tag. For example:

.my_div:hover{
border: 1px solid #000000;
}

However in order for this to work the DOCTYPE needs to be declared in the HTML file.

<!DOCTYPE HTML>
<html>
<head>
...

Thursday, 7 April 2011

Guide to Components

There are a lot of numbers and letters out there in the computer component world but hopefully this guide will explain what to look out for.

It refers mainly to modern highend components for gaming or multimedia design.

Processor

Recommended: AMD, Intel

Cores
There are currently three main cores Dual(2), Quad(4) and Hex(6), the more the better.

Speed
Ranging from around 2MHz to 4MHz, the faster the better.

Cache
Modern CPU's have an L3 cache ranging from around 2MB to 8MB, the higher the better.

Socket
CPU and motherboard sockets need to match to fit properly.

Motherboard

Recommended: ASUS
, EVGA, Gigabyte, Micro-Star International (MSI), Sapphire, XFX

Chipset (northbridge)
There are two main chipset manufacturers AMD and Intel. Although they have speeds it is easier to distinguish chips by their model.

The main AMD models are 890FX, 890GX, 880G & 870 in descending order of 'power'.

The main Intel models are X58, P67(B3) & P55 in descending order of 'power'.
Note: P67(B2) chips have been recalled
due to a hardware bug and should be avoided.

Front Side Bus (FSB)
Speed of data transfer
between CPU and northbridge. The higher the better.

Multi-GPU
The chipset determines what graphics cards (ATI/Nvidia) can be used in a multi card setup (CrossfireX/SLI). Some X58 and P55 b
oards can support both SLI and CrossfireX but any board considered should be checked for what configuration is supported.

Socket
This determines what processors the board supports.

Memory
This determines the type, speed and maximum memory supported.

Expansion (PCI) Slots
These will determine what cards (Graphics, Audio, WIFI etc) can be attached. PCIe 2.0 is measured in three spee
ds x16, x8 & x4, usually decreasing per slot as more cards are added.

Size
There many form factors but the two main sizes are ATX(standard) and micro-ATX (mATX).

Graphics Card

Recommended: ASUS, EVGA, Gain
ward, Gigabyte, HIS, Micro-Star International (MSI), Palit, PNY, Sapphire, XFX, Zotac

Cores
Some expensive highend cards have two cores but most will have one.

Core Clock
Ranging from around 600MHz to 1000MHz, the faster the better.

Memory
Graphics memory is in GDDR5 format and ranges from around 512MB to 4GB, the higher the better.

Memory Clock
Ranging from around 800MHz to 1500MHz, the faster the better.

Memory Interface
Ranging from around 64bit to 256bit, the higher the better.

DirectX Support
Cards should support the latest DirectX version (currently 11).

Resolution
There are many resolutions which dif
fer between cards and outputs (DVI/HDMI) but in general they will likely be between HD720 and WQXGA, the higher the better.


Memory (RAM)

Recommended: Corsair, Crucial, G-Skill, Kingston, OCZ

Size (storage)
Usually ranging from around 1GB to 4GB per module.

Type
The latest memory type is DDR3.

Speed
Ranging from around 1066MHz to 2000MHz, the higher the better.

Latency
Ranging from CL5 to CL9, the lower the better.

Power Supply Unit (PSU)

Recommended: Antec, Be Quiet, Coolermaster, Corsair, Enermax, Kingwin, OCZ, Silverstone, Thermaltake

Power
Ranging from around 300W to 1200W, the higher the better.

Connectors
Modular units only need required connectors to be attached, Non-modular unit's connectors can not be detached.

Connector outputs should match up with required power inputs on motherboard and graphics cards.

The following site can be used to get an idea of the power a system will require.

Solid State Drive

Recommended: Corsair, Crucial, Kingston, Seagate, OCZ, Western Digital

Capacity
Ranging from around 8GB to 1TB, the higher the better.

Read/Write
Ranging from around 30MB/s to 740MB/s, the higher the better.

Hard Drive

Recommended: Seagate, Western Digital

Size
Either 2.5" (laptop/SSD) or 3.5" (standard).

Capacity
Ranging from around 30GB to 3TB, the higher the better.

Speed
Either 54,000rpm (laptop), 72,000rpm (standard) or 10,000rpm, the higher the better.

Cache
Ranging from around 8MB to 64MB, the higher the better.

Cooler
A custom water cooling system is the best performing cooling solution however these are expensive and complicated to install, therefore I have left them out.

Recommended: Coolermaster, Corsair, Noctua, Thermalright, Prolimatech, Zalman

Their isn't a quantifiable way to choose a cooler but there are plenty of reviews out there. This is a list of some of the well regarded coolers:
  • Thermalright Ultra 120
  • Prolimatech Megahalems
  • Coolermaster V8
  • Corsair H5O or H7O
  • Noctua NH-D14

Case

Recommended: Antec, Coolermaster, Corsair, Lian Li, Silverstone

Again it is hard to quantify what makes a good case and mainly it will be down to personal preference. The case should support the motherboard form factor, have enough room for any graphics cards and fans should have dust filters.

There are plenty of reviews online and this is a list of some of the most popular cases:
  • Coolermaster HAF 932
  • Coolermaster Cosmos
  • Antec 1200
  • Silverstone Raven 2

This has taken a lot longer than I first thought so I hope it is of use. I'm sure there are plenty of opinions and recommendations out there so feel free to leave them in the comments.