2 Replies - 1057 Views - Last Post: 19 March 2010 - 07:44 PM

#1 bmcc81  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 320
  • Joined: 10-July 07

CSS Problem - Sends my content to the left in Firefox

Posted 19 March 2010 - 10:07 AM

Hi,

I'm making a site where I had to move the index page main content over -8px to makwe it center from one page to the next.
Web Site Link It works fine in IE but when I check it in Firefox it send the whole thing over to the left.

These Page Move (About - In The News - Links)

I think it's because in my CSS I use:

.moveLeft { 
	margin-left:-8px;
}




Is there a peice of code that I can us to write an If statement that will not show this code if in Firefox?

Thanks in advance,
bmcc81

Is This A Good Question/Topic? 0
  • +

Replies To: CSS Problem - Sends my content to the left in Firefox

#2 moopet  Icon User is offline

  • binary decision maker
  • member icon

Reputation: 343
  • View blog
  • Posts: 1,189
  • Joined: 02-April 09

Re: CSS Problem - Sends my content to the left in Firefox

Posted 19 March 2010 - 12:42 PM

I'm taking a wild guess here, but I think your centring issue is to do with the pages which have a scroll bar. Pages shorter than most people's window height won't have a scroll bar and you're seeing a difference of a few pixels.
Trying to correct this with a negative margin is not a good idea. For one thing, some people will have a scroll bar always visible anyway (preferences in some browsers or short windows). For another, if the content on those short pages grows when the news changes, suddenly they'll jump around. For another, hey, it's how things get centred on other sites - don't worry about it.

If you're determined, though, you could put your layout table (eww) inside a DIV, style the DIV with "margin: auto;text-align: left" and a width 8px wider than the table is...
That would give you the result you wanted. But it's horrible HTML. I'd just not bother trying to fix it - it's not a real problem.

If it's something else you're trying to fix, I apologise for ranting on about the wrong thing.
Was This Post Helpful? 0
  • +
  • -

#3 Excavator  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 21
  • View blog
  • Posts: 60
  • Joined: 10-December 06

Re: CSS Problem - Sends my content to the left in Firefox

Posted 19 March 2010 - 07:44 PM

Hello bmcc81,
Instead of targeting specific browsers or using that .moveLeft class, just make sure there is a scroll bar in all browsers. That way it never shifts over.
Make your CSS look like this -
<!--
body {
	background-image: url(images/backgroundFull.jpg);
overflow-y: scroll;
}


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1