DotDragnet
May 23, 2012, 01:41:53 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Mobile users - Our forum is Tapatalk enabled. http://www.tapatalk.com/
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: margin-left doesn't exist  (Read 1923 times)
Barney McGrew
Sr. Member
****
Posts: 257


Resident Firefighter


View Profile WWW Awards
« on: April 11, 2008, 08:52:51 PM »

Whilst checking my CSS file, I have 2 errors, both saying "margin-left doesn't exist". From what I can gather its no longer used in the method I have done. Having searched Google etc, I am unsure on how to fix it. Simply removing it fouls the page up. ?

This is what I have used

Code:
#page
{
width:500px;
float:left;
margin-right:-717px;
margin-left:217px;
margin-bottom:20px;
_margin-left:110px;
}
Logged
Barney McGrew
Sr. Member
****
Posts: 257


Resident Firefighter


View Profile WWW Awards
« Reply #1 on: April 11, 2008, 09:00:03 PM »

Mmm, I have just removed them again and everything seems fine. I take it these are not required or am i missing something?
Logged
sarahA
DDN Contribs
Hero Member
*****
Posts: 2174



View Profile WWW Awards
« Reply #2 on: April 11, 2008, 09:18:30 PM »

i've never seen an _margin-left before, which it what you have below margin-bottom.

For margins I use

Code:
margin: -717px 0 20px 217px;

where it's margin: top right bottom left. But that's just shorthand, margin-left should be fine.
Logged

JasonD
Global Moderator
Hero Member
*****
Posts: 546



View Profile Awards
« Reply #3 on: April 11, 2008, 09:26:59 PM »

The _ is to set a different value for MSIE (other browsers will correctly ignore that line). It won't validate though.
Logged
Mr Anderson
DDN Contribs
Hero Member
*****
Posts: 2267



ap4a.uk ap4a
View Profile WWW Awards
« Reply #4 on: April 11, 2008, 09:33:37 PM »

Use a conditional comment to link to a separate IE 6 stylesheet rather than using a hack:

Code:
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="ie6andunder.css" media="screen" />
<![endif]-->

Put that after the link to your main stylesheet(s) and in the linked ie6andunder stylesheet set the margin to be half what it is in the main CSS.
Logged

sarahA
DDN Contribs
Hero Member
*****
Posts: 2174



View Profile WWW Awards
« Reply #5 on: April 11, 2008, 09:34:09 PM »

Ahh okay, cheers Jason. Never knew that smile
Logged

Barney McGrew
Sr. Member
****
Posts: 257


Resident Firefighter


View Profile WWW Awards
« Reply #6 on: April 11, 2008, 09:46:29 PM »

It actually looks oK in both IE7 and Firefox without it. I take it some browsers like IE6 will see it differently.

Im confused now.
Logged
Mr Anderson
DDN Contribs
Hero Member
*****
Posts: 2267



ap4a.uk ap4a
View Profile WWW Awards
« Reply #7 on: April 11, 2008, 10:22:15 PM »

It actually looks oK in both IE7 and Firefox without it. I take it some browsers like IE6 will see it differently.

Im confused now.

IE 6 doubles float margins.  It's a bug.

For example, if you have a div floated left and give it a 10px margin in IE 6 and under the left hand margin will be doubled to 20px. The other three margins will be unaffected. If you have a div that you float right and give it a 20px margin in IE 6 the right hand margin will be double to 40px.

« Last Edit: April 11, 2008, 10:24:52 PM by Mr Anderson » Logged

Barney McGrew
Sr. Member
****
Posts: 257


Resident Firefighter


View Profile WWW Awards
« Reply #8 on: April 11, 2008, 10:30:53 PM »

Mmm, thought I was doing too well. I guess I am going have to make a new ie style sheet just for IE6. I have tried it over at browsershots.org and there only seems to be IE6 that comes up with differences.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!