Webdoodles

June 27, 2007

HTML Tag Reference

Filed under: HTML Help, Tools, Website Accessibility — ukmagician @ 12:02 pm

It’s not easy to remember the multitude of html tags and their attributes, so it’s good to have somewhere to go for a quick recap.

My favourite site for most HTML help is Your HTML Source, which has a great glossary of HTML tags. It clearly outlines the correct usage for the all the common tags and many you might not normally think of using.

It’s a good idea to use an existing tag if possible, rather than defining your own class, as it makes your code more compliant with web standards and screen readers.

June 16, 2007

Centering a Layout Horizontally

Filed under: Centered, Layouts — ukmagician @ 10:58 am

This is, what should be, a simple technique for centering a page horizontally in the browser window.

Logically, you would think all you have to do is wrap your content in a div, give this div a width (say 760px so it fits nicely on a screen resolution of 800 x 600) and set the left and right margins to ‘auto’.

#centeringwrapper {
width: 760px;
margin: 0 auto;
}

This works in Firefox and other browsers which display CSS correctly, but of course with Internet Explorer nothing is that straight forward.

IE doesn’t interpret the automatic left and right margins. However we can use another incorrect CSS interpretation to achieve the desired effect in IE. If you apply a centering text alignment to the body tag, IE applies it to all divs within the body, thus centering them. However, this also centers all body text on the page so we need a further fix to reset the text to align to the left.

Finally, the body tag needs to have a minimum width equal to the width of the centering wrapper. This deals with an issue in older Mozilla browsers where reducing the size of the browser window results in half of your centered div hanging off the left of the page.

So the final CSS looks like this:

body {
text-align:center; /* IE centering fix */
min-width: 760px; /* Mozilla resizing fix*/
}
#centeringwrapper {
width: 760px;
text-align:left; /* Negates IE centering fix in other browers*/
margin: 0 auto; /* Ccentering in non-IE browers*/
}

June 6, 2007

Lorem Ipsum Text Generator

Filed under: Design, Tools — ukmagician @ 12:28 pm

Lorem Ipsum text is dummy text used to fill out page layouts so you can see what the design will look like with text flowing through it.

It has the same spacing and structure as real text, but because it is Latin the reader is not distracted by the meaning of the words (unless you understand Latin of course).

The Lorem Ipsum Generator generates however many paragraphs or sentences of dummy text you need.

Blog at WordPress.com.