#! /usr/bin/perl
use strict;
use warnings; #Always use these!
my @no = (1 .. 100);
foreach(@no) {
print "\#world" . $_ . " \{
background: url(/images/1.png) 0 0 no-repeat;
float: left;
width: 1%;
height: 2%;
position: absolute;
top: " . $_ . "\%;
left: " . $_ . "\%;
z-index: -1;
margin-top: -10px;
margin-left: -10px;
\}
\#world" . $_ . ":hover \{
background-position: 0 -20px;
cursor: pointer;
\}";
}
в настоящее время этот скрипт Perl выводит #world1, top: 1%; left: 1%;
, где проценты одинаковы.Как я могу изменить скрипт для вывода world(1 through to 100) top: 1%; left: (1% through to 100%)%; world(101 through to 201) top: 2%; left: (1% through to 100%)%;
до world(19001 through to 20000) top: 100%; left: (1% through to 100%)%;