Jump to content

[SOLVED] fieldset bg color display error in IE7


MP145

Recommended Posts

Hi guys,

 

I have set a background color to my fieldset in a form. It works like a charm in FF3.05, but on IE7 the background color extends above the fieldset border. Can this be rectified ?

 

Here is my code :

 

Css:

fieldset {
border: 1px solid #313325;
background-color: #cbcbcb;
padding: 10px;
margin-bottom: 20px;
}
legend {
color: #fff;
background: #313325;
border: 1px solid #4d4f40;
padding: 2px 6px;
}

 

Html:

<fieldset>
<legend>CONTACT INFORMATION</legend>
<div class="fieldwrapper">
<label for="name" class="styled">Your Name:</label>
<div class="thefield">
	<input type="text" id="name" value="" size="30" />
</div>
</div>
</fieldset>

 

Thanks.

Brilliant!!!

 

Thank you very much for the reply phparray  ;D

 

Apparently the holly hack doesn't work, so had to load a diff css file with conditional statement.

 

This is my working code now :

 

Separate Css from the one above

fieldset {
position: relative;
margin-top:3em;
padding-top:2em;
}
legend{
position:absolute;
top: -1em;
left: .5em;
}

 

on the html page

<link href="formstyle.css" rel="stylesheet" type="text/css" />
<!–-[if gt IE 6]>
  <link href="formstyleie.css" rel="stylesheet" type="text/css" />
<![endif]–->

 

and it works. As Matt would have said again "Voila!!!"

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.