Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE padding required to affect margin. 1

Status
Not open for further replies.

1DMF

Programmer
Joined
Jan 18, 2005
Messages
8,795
Location
GB
Hi,

I've had to create an [IF IE] clause in my code to force my <fieldset> tags to have a margin between each other.

It seems the margin is ignored in IE, but if I put padding I get the required margin.

Is this one of those IE / Form element problems?





"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
It almost sounds like a collapsing margins issue (those are usually cured by adding padding), but it is impossible to tell without seeing your page.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
sorry : same page as other issue...


The middle floated div #pagetext has a bunch of non-floated fieldsets , the margin is ignored in IE, but padding fixes this.

All works fine in FF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Hard to say. It is not the collapsing margins issue, I think there's a proprietary value that IE puts in for the display attribute of the fieldset that somehow ignores the margins. I think it should work if you state the obvious and add [tt]display: block[/tt] to the style declaration of the fieldsets.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Spot on Vragabond, that did the trick - well sort of, damn you IE! - lol

The irony is the fieldsets then adheared to the margin, but the padding made the margin 20px (10px margin - 10px padding), so it still applied the padding as margin.

Web browsers are like the old saying 'You can't please all the *insert here (*people / *browsers) all the time!"

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
But if you leave just the margin and add the display property for all browsers, wouldn't that give you uniform results? Weren't you using padding only in IE to combat its lack of applying the margin?

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Yes!

I was just noting the irony of IE, that until I removed the now unwanted padding form the head code of the [IF IE] clause, it showed double margin.





"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top