Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Coding For Multiple Browsers

Featured Replies

Hey,

I'm trying to make this site work in Firefox, IE and Safari.

It all looks good in IE but when you move into Firefox and Safari they seem to add random gaps everywhere. for example there is a larger gap between the main header and main content text, and a gap between the main content div and the footer div.

any suggestions on how to remove these? I have tried using a negative margin but this screws it up in IE.

 

Thanks

swigs

Hey,

I'm trying to make this site work in Firefox, IE and Safari.

It all looks good in IE but when you move into Firefox and Safari they seem to add random gaps everywhere. for example there is a larger gap between the main header and main content text, and a gap between the main content div and the footer div.

any suggestions on how to remove these? I have tried using a negative margin but this screws it up in IE.

 

Thanks

swigs

 

sounds like it might be list items or images such like adding default padding or margins if different browsers.

 

a link and some code would help us to help...

Lots of problems occur when not specifiying Padding and Margin's and yes as headcoat says a link would help.

Big tip for today - design for standards compliant browsers like Firefox/Opera/Safari first then tweak for IE.

 

The big problem you're facing is that IE does not render HTML/CSS correctly so nine time sout of ten things will break in the other browsers. Let's see a link then we'll be able to diagnose for you :)

Hi

 

Am at work so can't go through thigns too much, but the fact that the first bar with links on drops below the news column strongly suggests IE is adding paddding to your <ul> and <li>.

 

Try addding padding : 0; and margin : 0;

 

To your stylesheet and go from there. Then add back in of you like.

As headcoat says changing padding/margin will help.

 

I suggest applying the universal padding/margin reset

 

* {padding: 0 margin: 0;}

 

this will reset all padding/margins to zero so you'll need to apply them on each style separately. Sounds like a lot of work but it cures a lot of IE failings.

* {padding: 0 margin: 0;}

 

...Nice thanks for that, I knew about padding: 0 margin: 0; but the Wildcard, who would have thought it, you learn something new everyday!

 

Thanks :)

  • Author

Honestly, thats the most amazing thing ever!!

I'm trying to be clever now and add a different bg image on either side of the header, so the dots look like they are all pointing into the middle. Unfortunatly the bg images seem to lay ontop of the header, is there anyway of putting them behind the header?

 

#bg {
width:100%;
vertical-align:top;
height:120px;
margin-bottom:-120px;
}
#bgleft {
background:url(/images/bgl.jpg) repeat-x;
height:120px;
width:40%;
float:left;
position:relative;
top:0px
}
#bgright {
background:url(/images/bgr.jpg) repeat-x;
height:120px;
width:40%;
float:right;
position:relative;
top:0px;
}

<body>
<div id="bg">
<div id="bgleft">
   </div>
   <div id="bgright">
   </div>
</div>
<div id="container">

I see what you're trying to do with the inward/outward slants. Hmmm, that's tricky. I think what I'd do is create a single background image and call it once. The image would probably have to be at least 1600px wide to be on the safe side, and as its not a complex image you should be able to optimise the file size to something reasonable.

 

The css to call it would be...

 

body {background: url(background.gif) repeat-x center top}

 

You can then overlay your header HTML over the top!

I see what you're trying to do with the inward/outward slants. Hmmm, that's tricky. I think what I'd do is create a single background image and call it once. The image would probably have to be at least 1600px wide to be on the safe side, and as its not a complex image you should be able to optimise the file size to something reasonable.

 

The css to call it would be...

 

body {background: url(background.gif) repeat-x center top}

 

You can then overlay your header HTML over the top!

 

 

i totally agree. i think this is the best option. as for coding for multiple browser try tweaking for IE. that is, use some some code in CSS that will be IE specific. in that way you will be assured that in all the browser the output is perfect.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.