• 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.68/day)
Likes
379
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
#1
Joined
May 27, 2008
Messages
3,577 (1.01/day)
Likes
533
Location
Huddersfield, uk
Processor E8200
Motherboard Asus P5KC
Cooling cooler master hyper tx3, 2x 120mm, 1x 80mm
Memory 4 GB DDR3 OCZ Black Edition
Video Card(s) Gigabyte HD 2600xt silent pipe II
Storage 500GB WD Sata / 60 GB Samsung IDE
Display(s) 20" samusng LCD, gaming at 1680 x 1050
Case some old amd thing
Audio Device(s) onboard
Power Supply 650W
Software Windows 8.1, with 'start is back' obviously
Benchmark Scores It boots whilst im still young so im pleased with that.
#2
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,469 (0.45/day)
Likes
381
Location
Toronto
Processor i7-2670QM / Q9550 3.6ghz
Motherboard laptop / Asus P5Q-E
Cooling laptop / Cooler Master Hyper 212
Memory 2x4gb ddr3sd / 2x2gb ddr2
Video Card(s) 570m / MSI 660 Gaming OC
Storage ST9750420AS / ST1000DM003
Display(s) BenQ FP241VW / BenQ GW2265HM
Case MSI gx780 / Corsair 500r
Audio Device(s) onboard
Power Supply laptop / Corsair 750tx
Mouse Steelseries Kinzu V2 / Logitech M120
Keyboard Logitech Deluxe 250 / Logitech K120
Software Windows 7
#3
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;