Killersites Community: Percentages :S - Killersites Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Percentages :S

#1 User is offline   danhodge 

  • PipPipPipPip
  • View blog
  • Group: Member
  • Posts: 131
  • Joined: 03-January 11
  • LocationEngland

Posted 12 March 2011 - 02:03 PM

There is literally no way i can begin to try and solve this problem :S

On firefox, a template i am creating works fine with the correct percentage, something around 80, however Internet Explorer and Opera require me to use 480% instead.

This is the code for the weird part, its the margin-left part which is causing this hassle:

#sidebar {
float: left;
[b]margin-left: 486%;[/b]
width: 110%;
border-width: 0px 1px 0px 0px;
border-color: black;
border-style: solid;
}


and for it to work in Firefox:


#sidebar {
float: left;
margin-left: 83%;
width: 20%;
border-width: 0px 1px 0px 0px;
border-color: black;
border-style: solid;
}


Thanks,
Danny

This post has been edited by danhodge: 12 March 2011 - 02:07 PM

On the long staircase to becoming a website designing professional
0

#2 User is offline   Susie 

  • PipPipPipPip
  • View blog
  • View gallery
  • Group: Advanced Member
  • Posts: 3,359
  • Joined: 19-December 08
  • LocationColumbus, OH

Posted 12 March 2011 - 02:47 PM

Just curious...why are you using percents for the margin? Can you show us a link to your page (or at least more of the code)?
0

#3 User is offline   danhodge 

  • PipPipPipPip
  • View blog
  • Group: Member
  • Posts: 131
  • Joined: 03-January 11
  • LocationEngland

Posted 12 March 2011 - 03:00 PM

Im centering the site, and i did the other measurements in percentages, so if i use pixels then it will only be centered on monitors the same size as mine...

And it seems to be corrected, but im not sure why, i just swapped some code around - but you can see the difference on the site here:

http://potatoes.netii.net/


Can you see what was wrong? I wouldn't mind knowing so i can avoid it next time :S
On the long staircase to becoming a website designing professional
0

#4 User is offline   Susie 

  • PipPipPipPip
  • View blog
  • View gallery
  • Group: Advanced Member
  • Posts: 3,359
  • Joined: 19-December 08
  • LocationColumbus, OH

Posted 12 March 2011 - 03:11 PM

Well, I'm viewing in Firefox and it's not centered at all. I've used percentages for container widths before (though I much prefer to use pixels) and it's totally fine to use pixels for positioning at the same time.

Just use this for centering your container:

margin: 0 auto;
0

#5 User is offline   danhodge 

  • PipPipPipPip
  • View blog
  • Group: Member
  • Posts: 131
  • Joined: 03-January 11
  • LocationEngland

Posted 12 March 2011 - 03:21 PM

Oh, thanks :)

I was unaware of that bit of easy code :L
On the long staircase to becoming a website designing professional
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users