Jump to content

Archived

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

dreamsight

Negative Margin Not Working In Internet Explorer

Recommended Posts

dreamsight

http://1071785999.n588565.test.prositehosting.co.uk/services/mot-welding/

 

I usually get around this issue but on this website i need to use 'Boxed Column' with a negative margin to bring the form up over the image.

 

im currently using this:

.column-boxed {
border-style: solid;
border-width: 0px;
box-sizing: border-box;
margin-bottom: 5px;
margin-top: -20em;
}
 

and it does the job on all browsers but Internet Explorer, and possibly Safari - i tried using:

top: -20em;
position: relative;
 

but it leaves a large white space where the form has been moved up from
 

 

Share this post


Link to post
Share on other sites
Danny

Hi,

 

IE doesn't like negative margins and doesn't render them properly, just another awesome feature of Internet Explorer. However, you shouldn't really use negative margins to position you content/elements. You should use relative or absolute and use top: -20px instead.

 

Please not that if you do use positions like these, you will likely need to use media queries for any issues you encounter when viewing on mobile devices.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
dreamsight

Hey Danny, thanks for your reply - gotta love IE.

 

I tried using absolute - but the form overlapped the content below it.

now i'm trying this:

.column-boxed {
border-style: solid;
border-width: 0px;
box-sizing: border-box;
margin-bottom: 5px;
top: -20em;
position: relative;
}

BUT there's now a large white space where the form has been moved up from, head is officially being scratched

Share this post


Link to post
Share on other sites
Danny

Try using absolute instead of relative and right: 0;


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Danny

If it overlaps on certain pages,  you will want to use the page-id-X class and add multiple CSS rules for individual pages. Its a pain but it will resolve your issue.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • Lisa Haran
      By Lisa Haran
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio+
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio+
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
    • nizami
      By nizami+
      Using navbar section with correctly configured WP menu to display main navigation at https://elenaangel.com. 
      All fine in desktop viewport. Menu displays twice in hamburger mode. How to fix this please? 

×