Web site development top tip – always start with a CSS reset

Always start a web site with a CSS reset. This sets all the elements CSS properties and avoids the inconsistency of various browsers default CSS properties for elements. Giving you a consistent starting point for building a cross browser compatible web site.

There are many to be found but generally very similar. Here is the one I use and has served its purpose perfectly well.


/* CSS Reset */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin:0;
padding:0;
}
table {
border-collapse:collapse;
border-spacing:0;
}
fieldset{
border:0;
}
img
{
border:none;
}
address,caption,cite,code,dfn,em,strong,th,var {
font-style:normal;
font-weight:normal;
}
ol,ul {
list-style:none;
}
caption,th {
text-align:left;
}
h1,h2,h3,h4,h5,h6 {
font-weight:normal;
}
q:before,q:after {
content:'';
}
abbr,acronym { border:0;
}
.clear
{
clear:both;
}
.bold-text
{
font-weight:bold;
}
.hide
{
display:none;
}
html,body
{
height: 100%;
}
:focus {outline:none;}
/* End CSS Reset */

Firefox refresh page retaining checkbox/radiobutton values

I had a page which uses codebehind Page_Load and (!IsPostBack) to setup all the controls on the page depending on what was being loaded. This worked fine, apart from when I refreshed the page (F5) in Firefox 3.5 – IE was okay.

Firefox seems to retain all the input selections – eventhough from the code behind I was ressetting them.

The only way I found to resolve this was to call a reset on the form (actually in my Master page) in the document ready function of JQuery which solves the problem.

$(document).ready(function() {

$(“#<%= (form1.ClientID) %>”)[0].reset();

});