Download jQuery/07_CSS操作2_heightwidth.html from zxy0307/Python_07_front_end: direct link, hf CLI and curl.
- Browser
- Download file 863 Bytes
-
https://huggingface.co/zxy0307/Python_07_front_end/resolve/main/jQuery/07_CSS%E6%93%8D%E4%BD%9C2_heightwidth.html
- Command line
-
hf download hf://zxy0307/Python_07_front_end/jQuery/07_CSS操作2_heightwidth.html
-
curl -L -o 07_CSS操作2_heightwidth.html https://huggingface.co/zxy0307/Python_07_front_end/resolve/main/jQuery/07_CSS%E6%93%8D%E4%BD%9C2_heightwidth.html
863 Bytes
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| <script src="./js/jquery-3.6.0.min.js"></script> | |
| <style> | |
| .box1{ | |
| width: 100px; | |
| height: 100px; | |
| background-color: red; | |
| } | |
| .box2{ | |
| background-color: green; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="box1"></div> | |
| <div class="box2"></div> | |
| <script> | |
| // 获取box1宽度和高度 | |
| var width = $(".box1").width(); | |
| var height = $(".box1").height(); | |
| console.log(width,height); | |
| // 设置box2的宽度和高度 链式调用 | |
| $(".box2").width(200).height(200); | |
| </script> | |
| </body> | |
| </html> |