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.

Link to comment
Share on other sites

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!!!"

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.