Update Panel .NET

Exploring Microsoft ASP.NET AJAX and jQuery

Archive for the ‘Update Panel’ Category

IE treats a fieldset with width as an inline element!

leave a comment »

I have found that if you apply a width to a fieldset element, IE7 (and earlier) treats it as an inline element, while all other browsers (and IE8) treat it as a block element.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Fieldset Example</title>
</head>
<body>
<style type="text/css">fieldset { width: 100px; }</style>
<fieldset><legend>Fieldset # 1</legend></fieldset>
<span>...etc...</span>
<fieldset><legend>Fieldset # 2</legend></fieldset>
<fieldset><legend>Fieldset # 3</legend></fieldset>
<span>...etc...</span>
</body>
</html>

To ensure cross browser compatibility, remember to set “display: block;” on your fieldsets.

Written by tzkuei

June 18, 2008 at 12:49 pm

Posted in CSS, HTML, Update Panel