Est. Read Time: ~Less Than a Minute
Need to center an absolute div on a page?
This is a simple CSS snippet will auto center an absolute positioned div. There are a few ways, but this bar far is the more simple approach.
1 2 3 4 5 6 7 8 9 10 |
.contentBlock { width: {define width} position: absolute; left: 0; right: 0; margin-left: auto; margin-right: auto; } |