This is a discussion on "[SOLVED] margin and padding in different browsers" within the Web Page Design section. This forum, and the thread "[SOLVED] margin and padding in different browsers are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] margin and padding in different browsers
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[SOLVED] margin and padding in different browsers
Is it just me...or does firefox and ie have different interpretations of margin and padding? If so, how is this problem solved?
Thanks, Danny322 |
|
|
|
#2
|
||||
|
||||
|
Re: margin and padding in different browsers
Yes they do.
I just use margin for positioning then use padding for adjustments. The way I was taught was to use Floats and Margins. I've NEVER come across a design that I had to hack to make work, nor have I ever had many problems with this method. Another thing is in FF Margin is from the top element I believe, where IE its from the previous element. So if you had a container div IE moves it down below the container an additional margin amount, while FF moves both container and inner div the same. To fix that, set the outer div to the margin and the inner div to the padding I believe...
Last Blog Entry: Happy Holidays - A Non Offensive way to say Merry Christmas? WRONG! (Dec 11th, 2007)
|
|
#3
|
||||
|
||||
|
Re: margin and padding in different browsers
One of the main issues is that the differing browsers have a differing default style sheets for certain elements, paragraphs, headings etc.
The most common way to get around this is to use the global whitespace reset:
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|
|
#4
|
|||
|
|||
|
Re: margin and padding in different browsers
Hi guys, thanks for the info.
Welshstew, just as an example im working on this site at the moment......... http://www.design365.co.uk/templates/temp1.htm In ie and firefox you'll notice a difference in the spacing between the 'our products' box and 'welcome to medical supplies', is it possible you could show me how to make the space the same? P.S ignore the left hand menu difference im still having trouble with that! Cheers, Danny322 |
|
#5
|
||||
|
||||
|
Re: margin and padding in different browsers
In IE7 I get a scroll bar on the right hand side, i'm pretty sure that is what is pushing your divs together.
Sort that out and it should be fine. try adding clear:both; to your clearing div to see if that helps
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|
|
#6
|
|||
|
|||
|
Re: margin and padding in different browsers
hi again welshstew
ive took the clearing divs out now, as u will see the middle boxes are all touching....... http://www.design365.co.uk/templates/temp1.htm I put clear: both; in but it seemed to mess it up. Im not sure wether i know how to properly set a clearing div, i want 10 pixels of space between the boxes, whats the best way to do this? Also, ive set the width of the banner and footer as 100% so it covers the whole page. Is this the correct way of doing it or is that why im getting a horizontal scroll bar? Thanks again, Danny322 |
|
#7
|
||||
|
||||
|
Re: margin and padding in different browsers
add margin-bottom:10px; to the long_slice div (I havn't checked IE yet - lets get FF back to normal first!
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|
|
#8
|
||||
|
||||
|
Re: margin and padding in different browsers
There are a number of ways to set up a clearing div.
the most simple one is:
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|
|
#9
|
|||
|
|||
|
Re: margin and padding in different browsers
ahhh welshstew the margin-bottom: 10px; worked a treat! Am i still getting a horizontal scroll bar? I havnt got IE7 on this comp thats all
|
|
#10
|
||||
|
||||
|
Re: margin and padding in different browsers
nope, no scroll bar, however, the bottom box (today's selected products) is aligned right on the bottom of footer, so you may want to have a look at that.
you can install ie7 and then get ie6 through multiple ie.
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|
|
#11
|
|||
|
|||
|
Re: margin and padding in different browsers
hmmm yea thats strange i thought the margin-bottom i put on the long_slice div would have put a space between that and the footer
|
|
#12
|
||||
|
||||
|
Re: margin and padding in different browsers
I would have thought so too.
If you change margin: 0px 10px 0px 0px; on long_container to margin: 0px 10px 10px 0px; then it adds the appropriate space. But FF is slightly bigger as a result. hhmmm, try adding a clearing div underneath that last long_slice
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|
|
#13
|
|||
|
|||
|
Re: margin and padding in different browsers
Thanks welshstew, the clearing div didnt work so i used the margin: 0px 10px 10px 0px;, i can live with the difference in space between browsers lol
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Padding and Margin | mcdanielnc89 | Web Page Design | 5 | Dec 24th, 2007 23:58 |
| Padding and margin for template does not work anymore | LGS | Web Page Design | 10 | Nov 30th, 2007 19:37 |
| Strange Padding/Margin | MaxCurrent | Web Page Design | 2 | Jul 24th, 2007 10:36 |
| margin? | nasumaru | Web Page Design | 14 | Jan 30th, 2007 21:52 |
| Align prob (padding? margin?) | m1k3 | Web Page Design | 5 | Jun 13th, 2006 16:02 |