Archive for the ‘HTML’ Category

add a header to a html list

Wednesday, April 13th, 2011

To get a header line in a html list the easiset way is to use the style list-style-type:none

<ul>
    <li style="list-style-type:none">Heading</li>
    <li>List items</li>
</ul>

Internet Explorer not rendering empty div correctly

Saturday, November 27th, 2010

Internet Explorer won’t render empty divs correctly.

I had a div with a height and a background image but no content; It was not rendered with the correct height it was only like one line.

A work around for this is to have some “content” inside the div (like a whitespace, a comment or why not both) then Internet Explorer renders the correct height.

<div class="some-class-with-size-and-background">
&nbsp;<!-- keep to get IE to render this div -->
</div>

HTML: UTF-8 encoding

Wednesday, July 14th, 2010

To get a html page to display UTF-8 encoded text correctly (without setting a default charset) simply add the following to the head of the html page.

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />