By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,493 Members | 1,920 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,493 IT Pros & Developers. It's quick & easy.

CSS problems with IE

mikeinspain
P: 21
Hi Guys..

Hope someone can help. I have a problem with a particular page on one of the sites I am developing. The page is here: http://tagwealth.co.uk/contact/.

The pages renders fine in Safari and Firefox, but it gets shunted to the left of the screen in IE.

The CSS for the page is below..

Expand|Select|Wrap|Line Numbers
  1. /********************************************
  2.    HTML ELEMENTS
  3. ********************************************/ 
  4.  
  5. /* top elements */
  6. * { padding: 0; margin: 0; }
  7.  
  8. body {
  9.     margin: 0;
  10.     padding: 0;
  11.     color: #333;
  12.     background: #FFF url(/images/bg.jpg) repeat-x;
  13.     text-align: center;
  14.     height: 100%;
  15.     font-family: Arial, Helvetica, sans-serif;
  16.     font-size: 0.72em;
  17.     font-style: normal;
  18.     line-height: 2.0em;
  19.     font-weight: normal;
  20.     font-variant: normal;
  21. }
  22.  
  23. /* links */
  24. a { background: inherit; color: #72A545; }
  25. a:hover { background: inherit; color: #006699; }
  26.  
  27. /* headers */
  28. h1, h2, h3 {
  29.     font: bold 1em 'Trebuchet MS', Tahoma, Sans-serif;
  30.     color: #82A7B0;
  31. }
  32. h1 { font-size: 1.4em; }
  33. h2 { font-size: 1.2em; text-transform: uppercase;}
  34. h3 { font-size: 1.2em; }
  35.  
  36. p, h1, h2, h3 {
  37.     margin: 10px 15px;
  38. }
  39. ul, ol {
  40.     margin: 10px 30px;
  41.     padding: 0 15px;    
  42.     color: #72A545;    
  43. }
  44. ul span, ol span {
  45.     color: #333;
  46. }
  47.  
  48. /* images */
  49. img {
  50.     border: 2px none #CCC;
  51. }
  52. img.float-right {
  53.   margin: 5px 0px 5px 15px;  
  54. }
  55. img.float-left {
  56.   margin: 5px 15px 5px 0px;
  57. }
  58. a img {  
  59.   border: 2px solid #72A545; /* #32CD32; */
  60. }
  61. a:hover img {  
  62.   border: 2px solid #806B4D !important; /* IE fix*/
  63.   border: 2px solid #72A545; /* #32CD32; */
  64. }
  65.  
  66. code {
  67.   margin: 5px 0;
  68.   padding: 10px;
  69.   text-align: left;
  70.   display: block;
  71.   overflow: auto;  
  72.   font: 500 1em/1.5em 'Lucida Console', 'courier new', monospace;
  73.   /* white-space: pre; */
  74.   background: #FAFAFA;
  75.   border: 1px solid #f2f2f2;  
  76.   border-left: 3px solid #72A545;
  77. }
  78. acronym {
  79.   cursor: help;
  80.   border-bottom: 1px solid #777;
  81. }
  82. blockquote {
  83.     margin: 15px;     padding: 0 0 0 20px;      
  84.       background-color: #FAFAFA; 
  85.     background-position: 8px 10px;
  86.     border: 1px solid #f2f2f2; 
  87.     border-left: 3px solid #72A545;  
  88.     font: bold 1.2em/1.5em "Trebuchet MS", Tahoma, sans-serif; 
  89.     color: #666666;    
  90. }
  91.  
  92. /* form elements */
  93. form {
  94.     margin:10px; padding: 0;
  95.     border: 1px solid #f2f2f2; 
  96.     background-color: #FAFAFA; 
  97. }
  98. label {
  99.     display:block;
  100.     font-weight:bold;
  101.     margin:5px 0;
  102. }
  103. input {
  104.     padding: 2px;
  105.     border:1px solid #eee;
  106.     font: normal 1em "Trebuchet MS", Tahoma, sans-serif;
  107.     color:#777;
  108. }
  109. textarea {
  110.     width:400px;
  111.     padding:2px;
  112.     font: normal 1em "Trebuchet MS", Tahoma, sans-serif;
  113.     border:1px solid #eee;
  114.     height:100px;
  115.     display:block;
  116.     color:#777;
  117. }
  118. input.button { 
  119.     margin: 0; 
  120.     font: bold 1em Arial, Sans-serif; 
  121.     border: 1px solid #CCC;
  122.     background: #FFF; 
  123.     padding: 2px 3px; 
  124.     color: #333;    
  125. }
  126.  
  127. /* search form */
  128. .searchform {
  129.     background-color: transparent;
  130.     border: none;    margin: 0; padding: 0;    
  131. }
  132. .searchform p { margin: 10px; padding: 0; }
  133. .searchform input.textbox { 
  134.     width: 130px;
  135.     color: #333; 
  136.     height: 20px;
  137.     padding: 2px;    
  138.     vertical-align: top;
  139. }
  140. .searchform input.button { 
  141.     font: bold 12px Arial, Sans-serif; 
  142.     color: #333;    
  143.     width: 60px;
  144.     height: 26px;
  145.     border: none;
  146.     padding: 3px 5px;    
  147.     vertical-align: top;
  148. }
  149.  
  150. /***********************
  151.       LAYOUT
  152. ************************/
  153.  
  154. #header-content, #content, #footer-content {
  155.     width: 760px;
  156. }
  157.  
  158. /* header */
  159. #header {
  160.     height: 100px;
  161.     text-align: left;    
  162. }
  163. #header-content {
  164.     position: relative;
  165.     margin: 0 auto; padding: 0;
  166. }
  167. #header-content #logo {
  168.     position: absolute;
  169.     letter-spacing: inherit;
  170.     color: #FFF;
  171.     margin: 0;
  172.     padding: 1;
  173.     /* change the values of left and top to adjust the position of the logo */
  174.     top: 9px;
  175.     left: 0px;
  176.     font-family: "ATRotis Semiserif 55", sans-serif, serif;
  177.     font-size: 30px;
  178.     font-weight: bold;
  179.     width: 288px;
  180.     height: 44px;
  181. }
  182. #header-content #slogan {
  183.     position: absolute;    
  184.     font: bold 1.1em 'Trebuchet Ms', Sans-serif;
  185.     text-transform: none;
  186.     color: #FFF;    
  187.     margin: 0; padding: 0;
  188.  
  189.     /* change the values of left and top to adjust the position of the slogan */
  190.     top: 55px; left: 40px;
  191. }
  192.  
  193. /* header menu */
  194. #header-content ul {
  195.     position: absolute;
  196.     right: -5px; top: 15px;
  197.     font: bolder 1.3em 'Trebuchet MS', sans-serif;
  198.     color: #FFF;
  199.     list-style: none;
  200.     margin: 0; padding: 0;        
  201. }
  202. #header-content li {
  203.     display: inline;
  204. }
  205. #header-content li a {
  206.     float: left;
  207.     display: block;
  208.     padding: 3px 12px;    
  209.     color: #FFF;
  210.     background-color: #333;
  211.     text-decoration: none;
  212.     border-right: 1px solid #272727;
  213. }
  214. #header-content li a:hover {
  215.     background: #65944A;
  216.     color: #FFF;
  217. }
  218. #header-content li a#current  {
  219.     background: #65944A;
  220.     color: #FFF;
  221. }
  222.  
  223. /* header photo */
  224. .headerphoto {
  225.     margin: 0 auto;
  226.     width: 770px;
  227.     height: 200px;
  228.     padding: 15px 10px 10px 10px; 
  229.     background: #FFF url(/images/headerphoto.jpg) no-repeat center;    
  230. }
  231.  
  232. /* content */
  233. #content-wrap {
  234.     clear: both;
  235.     float: left;
  236.     width: 100%;
  237. }
  238. #content {
  239.     text-align: left;    
  240.     padding: 0;
  241.     margin: 0 auto;    
  242. }
  243.  
  244. /* sidebar */
  245. #sidebar {
  246.     float: right;
  247.     width: 30%;
  248.     margin: 0 0 10px 0; padding: 0;    
  249. }    
  250. #sidebar h1 {
  251.     padding: 10px 0px 5px 10px;
  252.     margin: 0;    
  253. }
  254. .sidebox {
  255.     background: #F2F2F2;
  256.     border: 1px solid #EFEDED;
  257.     margin-bottom: 10px;
  258. }
  259.  
  260. /* sidebar menu */
  261. #sidebar ul.sidemenu {
  262.     list-style:none;
  263.     margin: 10px 0;
  264.     padding: 0;
  265.     background: #F2F2F2;            
  266. }
  267. #sidebar ul.sidemenu li {
  268.     padding: 0px 10px;
  269. }
  270. #sidebar ul.sidemenu a {
  271.     display:block;
  272.     font-weight:normal;
  273.     color: #333;
  274.     height: 1.5em;    
  275.     padding:.3em 0 .3em 15px;
  276.     line-height: 1.5em;
  277.     border-bottom: 1px dashed #CCC;
  278.     text-decoration:none;
  279. }
  280. #sidebar ul.sidemenu a.top{    
  281.     border-top: 1px dashed #CCC;
  282. }
  283. #sidebar ul.sidemenu a:hover {
  284.     padding: .3em 0 .3em 10px;
  285.     border-left: 5px solid  #65944A;
  286.     color: #65944A;        
  287. }
  288.  
  289. /* main */
  290. #main {
  291.     float: left;
  292.     width: 68%;    
  293.     margin: 0 0 10px 0; padding: 0;    
  294. }
  295. #main h1 {
  296.     padding: 10px 0 5px 5px;
  297.     margin: 0 0 0 10px;
  298.     border-bottom: 1px solid #f2f2f2;     
  299. }
  300.  
  301. .post {
  302.     margin: 0;
  303.     padding: 0;
  304.     border: 1px solid #EFEDED;
  305.     background-color: #FFF;
  306.     background-image: url(/images/gradientbg.jpg);
  307.     background-repeat: repeat-x;
  308. }
  309. .post .post-footer {
  310.     background-color: #FAFAFA;
  311.     border: 1px solid #f2f2f2;
  312.     padding: 5px; margin-top: 20px;
  313.     font-size: 95%;
  314. }
  315. .post .post-footer .date {
  316.     background: url('clock.gif') no-repeat 0 center;
  317.     padding-left: 20px; margin: 0 10px 0 5px;
  318. }
  319. .post .post-footer .comments {
  320.     background: url('comment.gif') no-repeat 0 center;
  321.     padding-left: 20px; margin: 0 10px 0 5px;
  322. }
  323. .post .post-footer .readmore {
  324.     background: url('page.gif') no-repeat 0 center;
  325.     padding-left: 20px; margin: 0 10px 0 5px;
  326. }
  327.  
  328. /* footer */
  329. #footer {
  330.     clear: both;
  331.     margin: 0; padding: 0;
  332.     font: normal .95em/1.5em 'Trebuchet MS', Tahoma, Arial, sans-serif;
  333.     text-align: left;    
  334. }
  335. #footer h3, #footer p {
  336.     margin-left: 0;
  337. }
  338. #footer-content {    
  339.     border-top: 1px solid #EAEAEA;
  340.     margin: 0 auto;
  341.     padding-left: 15px;
  342. }
  343. #footer-content a {
  344.     text-decoration: none;
  345.     color: #777;    
  346. }
  347. #footer-content a:hover {
  348.     text-decoration: underline;
  349.     color: #333;
  350. }
  351. #footer-content ul {
  352.     list-style: none;
  353.     margin: 0; padding: 0;
  354. }
  355. #footer-content .col {
  356.     width: 32%;
  357.     padding: 0 5px 30px 0;    
  358. }
  359. #footer-content .col2 {
  360.     width: 33%;
  361.     padding: 0 0 30px 0;    
  362. }
  363.  
  364. /* alignment classes */
  365. .float-left  { float: left; }
  366. .float-right { float: right; }
  367. .align-left  { text-align: left; }
  368. .align-right {    text-align: right; }
  369.  
  370. /* additional classes */
  371. .clear { clear: both; }
  372. .gray  { color: #BFBFBF; }
  373.  
I have no idea why this happening. Would someone be kind enough to point me in the right direction. Thanks Mike
Apr 19 '07 #1
Share this Question
Share on Google+
6 Replies


mikeinspain
P: 21
PS: I forgot to include this bit of CSS that is in the php file.

Expand|Select|Wrap|Line Numbers
  1.     <style type='text/css' media='screen,projection'>
  2.         <style type='text/css' media='screen,projection'>
  3.     <!--
  4.     body { margin:20px auto;width:500px;padding:20px;border:1px solid #ccc;background:#fff;font-family:georgia,times,serif; }
  5.     fieldset { border:0;margin:0;padding:0; }
  6.     label { display:block; }
  7.     input.text,textarea {
  8.     width:300px;
  9.     color:#333;
  10.     padding:3px;
  11.     margin:1px 0;
  12.     border:1px solid #ccc;
  13.     font-family: 'courier new', courier, monospace;
  14.     font-size: 16px;
  15.     line-height: 25px;
  16. }
  17.     input.submit { padding:2px 5px;font:bold 12px/12px verdana,arial,sans-serif; }
  18.  
  19.     -->
  20.     </style>

thanks Mike
Apr 19 '07 #2

drhowarddrfine
Expert 5K+
P: 7,435
As usual, the solution is validate your html and css and fix the errors listed there.
Apr 19 '07 #3

mikeinspain
P: 21
As usual, the solution is validate your html and css and fix the errors listed there.
Thanks for that. I am have tried going through the 2 error pages for xhtml and css, but I really can't seem to get this particular page to display correctly in IE. As mentioned safari, firefox etc.. are all ok and indeed IE except for the one page where it all gets shifted to the left...

Is it a case of perhaps inputting a little IE hack to render it correct on the screen or is there perhaps an easier solution?

I have reverted back to the original code for this page now.

Thanks

Mike
Apr 20 '07 #4

drhowarddrfine
Expert 5K+
P: 7,435
iirc, and it is the case now, you are missing the ending </style> tag. How does IE react to this? I don't know. But it's hard enough to work with code that validates than one with 20 html errors as it is now. Maybe it will fix it, maybe it won't. But at least we can eliminate those possibilities.
Apr 20 '07 #5

mikeinspain
P: 21
iirc, and it is the case now, you are missing the ending </style> tag. How does IE react to this? I don't know. But it's hard enough to work with code that validates than one with 20 html errors as it is now. Maybe it will fix it, maybe it won't. But at least we can eliminate those possibilities.
Sorry if this is a really stupid question, and I really appreciate your help but below is my first rows of code: I see that I have that tag </style> there..??

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3. <head>
  4.     <script type="text/javascript" src="js/functionAddEvent.js"></script>
  5.     <script type="text/javascript" src="js/contact.js"></script>
  6.     <script type="text/javascript" src="js/xmlHttp.js"></script>
  7.     <style type='text/css' media='screen,projection'>
  8.         <style type='text/css' media='screen,projection'>
  9.     <!--
  10.     body { margin:20px auto;width:500px;padding:20px;border:1px solid #ccc;background:#fff;font-family:georgia,times,serif; }
  11.     fieldset { border:0;margin:0;padding:0; }
  12.     label { display:block; }
  13.     input.text,textarea {
  14.     width:300px;
  15.     color:#333;
  16.     padding:3px;
  17.     margin:1px 0;
  18.     border:1px solid #ccc;
  19.     font-family: 'georgia,times,serif;
  20.     font-size: 16px;
  21.     line-height: 25px;
  22. }
  23.     input.submit { padding:2px 5px;font:bold 12px/12px verdana,arial,sans-serif; }
  24.  
  25.     -->
  26.     </style>
  27. <meta name="Description" content="Information architecture, Web Design, Web Standards." />
  28. <meta name="Keywords" content="your, keywords" />
  29.  
  30. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  31. <meta name="Distribution" content="Global" />
  32. <meta name="Author" content="Erwin Aligam - ealigam@gmail.com" />
  33. <meta name="Robots" content="index,follow" />
  34. <link rel="stylesheet" href="/css/PixelGreen.css" type="text/css" />
  35. <title>//  TAG WEALTH MANAGEMENT  //  Pensions  //  Investments  //  Retirement Planning  //</title>
  36. </head>
Apr 20 '07 #6

drhowarddrfine
Expert 5K+
P: 7,435
I just went by what the validator said. But you have two <style> tags. Remove one. Might be confusing to a browser. Also, add a <title></title>. That will confuse the validator, too.
Apr 20 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.