如何放大从较大图像位置显示的图像?

时间:2016-11-04 11:51:57

标签: css

我有一个div。该div显示图像。图像显示为从较大图像切割的精灵,如下所示:

$output_dir = DOCUMENT_ROOT."/uploads/";
    $file = $_FILES['resume'];
    if($_FILES['resume']['name'] != "") {
        $allowedExts = array("pdf", "doc");
        $extension = end(explode(".", $_FILES["resume"]["name"]));
        if (
            ($_FILES["resume"]["type"] == "application/pdf") ||
            ($_FILES["resume"]["type"] == "application/msword") ||
            ($_FILES["resume"]["type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document") &&
            ($_FILES["resume"]["size"] < 20000000) && in_array($extension, $allowedExts)
        ) {

            move_uploaded_file($_FILES["resume"]["tmp_name"],$output_dir.$_FILES["resume"]["name"]);
            $value['resume'] = $_FILES["resume"]["name"];

            $this->xyz_model->update_tabel_user_data($user_id,$value);
            redirect(site_url(user/demo'));
          }
        }

div大小为16x16。我希望将div大小增加到32x32,从myBiggerImage.jpg切下16x16片段,从现在的位置开始,缩放2次,以适应32x32 div。

如何完成它?

1 个答案:

答案 0 :(得分:0)

您要找的是scale()

someselector {
    -webkit-transform:scale(2);
    -moz-transform:scale(2);
    -o-transform:scale(2);
    -ms-transform:scale(2);
    transform:scale(2);
}

您可以在Can I Use查看其支持。

相关问题