- Modifying Exif Information Using ASP.NET
- sqldatasource throwing null reference exception
- Formatting ADO GetString
- Integrate PHPBB With PayPal Subscriptions
- Integrate A Website With Sage50
- Classic ASP Web Development
- url rewrite rule converter
- Error BC30002 usercontrol not defined
- paypal discount_rate_cart not being applied
- kindle screen test
- accessdatasource converting empty strings to null values
- paypal ipn returns invalid
- cannot manually edit applicationhost.config
- must declare the scalar variable
- classic asp and access not working on windows 2008 64bit
- asp.net page titles are blank
- sql to get totals for last six months
- white space being counted as a node
- cross page posting not working
- collection is read only exception
- PayPal sending incorrect carrier information
- paypal guest user notice
- classic asp dictionary not working
- IE8 not supporting innerHTML
- differences between jet and odbc
- sugarcrm not inserting email
- select random records from access
- button click event firing twice
- how to send an email using cdosys
- installing perl on win2003 64 bit
- asp.net page event order
- rewrite rule for subdomains only
- extra items in javascript array
- IE7 margin auto not working
- IE7 border style dotted glitch
- ByRef and ByVal in vbscript
- weather rss feed
- Classic asp crib sheet
- Firefox onsubmit image change
- limit records in access
- AccessDataSource is thick
- double margins in IE6
- extra image padding in html emails
- decimal places in linux flash player
- broken emails in outlook 2007
- double spaced IE list items
- cannot remove movieclip
articles:
IE7 margin auto not working
<style type="text/css">
div{width: 50em; margin:0 auto; border:1px solid #CCCCCC}
</style>
.....
.....
<body>
<div>hello world</div>
</body>
....
...
In IE6, Firefox,opera and safari (well at least safari on windows) the above code will render a 50em wide DIV with a grey border in the middle of the window, regardless of the width of the window. However, in IE7 the DIV will be left aligned.There is a quick, if a little unsatisfactory fix to this problem, see the revised <style> section below:
<style type="text/css">
body{text-align: center}
div{text-align: left; width: 50em; margin:0 auto; border:1px solid #CCCCCC}
</style>This will now render a 50em wide DIV with a grey border in the middle of the window regardless of the width of the window in IE7 as well as in the other browsers.
Comments
Posted on 01 November 2010 13:17:00 GMT by Chris Brandrick
Thanks for this, simple fix. Just works.
Posted on 09 November 2010 14:03:00 GMT by Redwan
Thanks Man it works fine for me.
Posted on 10 August 2011 07:38:00 GMT by Raton
Thanks !!! It works just fine :)
Posted on 14 October 2011 12:53:00 GMT by claus Fischer
Thank you! Simple fix, and it works.
Posted on 28 October 2011 07:14:00 GMT by Jake Dacquel
woo!! Thank you bro! super thanks! it works.. =D
Posted on 01 November 2011 16:34:00 GMT by Adil
If your doctype isn't FULL/correct, IE kicks into quirks mode. Quirks mode doesn't support the margin property. So, make this your doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
You can go to http://www.w3.org/QA/2002/04/valid-dtd-list.html and pick a separate doctype.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
You can go to http://www.w3.org/QA/2002/04/valid-dtd-list.html and pick a separate doctype.
Posted on 24 January 2012 16:37:00 GMT by anonymous
Thanks for the doctype tip! Worked like a charm.
Posted on 21 April 2012 09:55:00 GMT by Ajs
Thanks.
Posted on 24 July 2012 07:29:00 GMT by anonymous
add this in top of ur code
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
Posted on 16 October 2012 10:36:00 GMT by Higgi
You've just rescued me... thx so much!
Post a comment
