Tuesday, April 16, 2013

z-index is kind of like old school 1980s BASIC in a way.

This reminds of this stuff that we used to do in the 1980s as kids when we weren't playing Zork:

10 PRINT "HELLO WORLD"
20 GOTO 10
RUN

 
 

Everyone who did BASIC wrote lines in increments of ten so that they could later jam in new lines of code between the increments of ten. You should not start at 1 as you are then making it impossible to have a line of code before line 1. In a similar manner, I would recommend setting the z-index property in CSS in increments of ten and especially so after reading this which leads me to believe that zero is not the default for z-index and you should not confidently believe that if you have only one specification for a z-index in CSS and that it is set to 1 that therefore anything using the class/id/tag will come out on top of other items not having it.

z-index: 10;

No comments:

Post a Comment