分享cropper剪切单张图片demo
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <title>上传头像</title> <link href="https://cdn.bootcss.com/cropper/3.1.3/cropper.min.css" rel="stylesheet"> <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <style type="text/css"> body{ text-align: center; } #user-photo { width:300px; height:300px; margin-top: 10px; } #photo { max-width:100%; max-height:350px; } //这个一定要设置,是容器的大小 .img-preview-box { text-align: center; } .img-preview-box > div { display: inline-block;; margin-right: 10px; } .img-preview { overflow: hidden; } .img-preview