• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Help centreing html5 canvas

Joined
Sep 15, 2009
Messages
2,076 (0.39/day)
System Name Omen
Processor i7-4710HQ
Cooling Dual fan/heatpipe
Memory 16GB
Video Card(s) 4GB GTX 860M
Storage 256GB PCIE SSD/256GB PNY UHS-1 SD Card
Display(s) 15.6' 1080P
Case Aluminium
Audio Device(s) Onboard
Power Supply Brick
Software Win 10
Joined
May 27, 2008
Messages
3,628 (0.62/day)
System Name Ultra 64
Processor NEC VR4300 (MIPS R4300i)
Motherboard proprietary design
Cooling Fanless aircooled
Memory 4.5MB 250 MHz RDRAM
Video Card(s) 62.5 MHz Reality Coprocessor
Storage 32 - 512 Mbit ROM Cartridge
Display(s) 720x576
Case Clear Blue Funtastic
Audio Device(s) 16-bit CD quality
Power Supply proprietary design
Mouse N64 mouse for use with N64DD
Keyboard N64 keyboard for use with N64DD
Don't know what youve done in the file because im at work so can't open it but here is how i performed the same thing.

Code:
canvas {
    padding-left: 0;
    padding-right: 0;
    padding-top:25px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    width: 1050px;
}

Don't know if that will work or be of any help, i tried so many different methods that people posted on the net and that was the only one to work.
 
Joined
Feb 9, 2009
Messages
1,618 (0.29/day)
display block & margin auto + a width is how things get centered

also it looks nicer to use shortform, the numbers will be top right bottom left

so for example, if you wanted a top margin, centered horizontally, it would look like margin: 25px auto 0px auto;

but in this case just do margin: auto;
 
Top