找回密码
 注册
搜索
免费空间 免费域名 免费AI 老牌主机商首月仅1美分!27美元/年!Spaceship优惠码 Namecheap优惠码阿里云2核2G3M新老续费同享99元/年!
楼主: ickern

[主机资源] Dewlance 15周年庆提供免费1GB空间

  [复制链接]
发表于 2024-1-14 23:18:21 | 显示全部楼层
这个必须绑ns吗?只A记录可不可以
 楼主| 发表于 2024-1-14 23:27:16 | 显示全部楼层
happy12 发表于 2024-1-14 23:18
这个必须绑ns吗?只A记录可不可以

可以A记录的,看我博客里面的说明
发表于 2024-1-14 23:38:22 | 显示全部楼层
ickern 发表于 2024-1-14 23:27
可以A记录的,看我博客里面的说明

好我试试
发表于 2024-1-15 00:29:54 | 显示全部楼层

刚才试了一下,你这代码不错,但如果再加上自动缩放就更好了
发表于 2024-1-15 09:16:55 | 显示全部楼层
happy12 发表于 2024-1-15 00:29
刚才试了一下,你这代码不错,但如果再加上自动缩放就更好了

web.xd94.com/photo.php

自己改一下css就可以了
发表于 2024-1-15 10:09:49 | 显示全部楼层
yaner 发表于 2024-1-15 09:16
web.xd94.com/photo.php

自己改一下css就可以了

完整打包的放出来吧
发表于 2024-1-15 10:44:55 | 显示全部楼层
本帖最后由 yaner 于 2024-1-15 10:49 编辑
efc88ff45580620 发表于 2024-1-15 10:09
完整打包的放出来吧

复制代码
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>导航→Navigation</title>
  5. <meta http-equiv="Content-Language" content="zh-cn" />
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <base target="_blank">
  9. <style>
  10. body {
  11.         margin: 15px;
  12.         font-size: 12px;
  13. }

  14. A:link {
  15.         COLOR: #000000;
  16.         TEXT-DECORATION: none
  17. }
  18. A:visited {
  19.         COLOR: #000000;
  20.         TEXT-DECORATION: none
  21. }
  22. A:hover {
  23.         TEXT-DECORATION: underline
  24. }

  25. .container {
  26.         text-align: center;
  27.         margin: 0px;
  28.         display: flex;
  29.         justify-content: center;
  30.         align-items: center;
  31.         height: auto;
  32. }

  33. .ccc {
  34.         background-color: #ffc;
  35.         box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  36.         border-radius: 5px;
  37.         padding: 10px;
  38. }

  39. .image-wrapper {
  40.         max-width: 100%;
  41.         width: 100%;
  42.         height: auto;
  43.         margin: 0px;
  44. }

  45. .footer {
  46.         text-align: center;
  47.         margin: 0px;
  48.         padding: 20px 0 50px 0;
  49. }
  50. .button {
  51.         margin: 0px;
  52.         padding: 10px 0;
  53. }

  54. @media only screen and (max-width: 600px) {
  55.         /* 小屏幕样式 */
  56.         body {
  57.                 margin: 10px;
  58.         }

  59.         .container {
  60.                 max-width: 100%;
  61.                 padding: 5px 10px;
  62.         }
  63. }
  64. </style>
  65. </head>
  66. <body>
  67. <div class="container">
  68.         <div class="ccc">
  69.                 <div class="image-wrapper">
  70.                         <img src="pic.php" style="max-width: 100%; height: auto;">
  71.                 </div>
  72.         </div>
  73. </div>

  74. <div class="footer">
  75.         <div class="button">
  76.         <button onclick="refreshPage()">刷新页面</button>
  77.         <script>
  78.                 function refreshPage() {
  79.                         location.reload();
  80.                 }
  81.         </script>
  82.         </div>
  83.         Copyright &copy;
  84.         <script type="text/javascript">document.write((new Date()).getFullYear());</script> 燕儿.
  85.         <a href="http://www.ddd.name">All rights reserved.</a>
  86.         <script type="text/javascript" src="https://js.users.51.la/51660.js"></script>
  87. </div>
  88. </body>
  89. </html>
复制代码


替换前面的index.php就可以了
发表于 2024-1-15 10:59:18 | 显示全部楼层
yaner 发表于 2024-1-15 10:44
替换前面的index.php就可以了

怎么还分了两段呢
发表于 2024-1-15 11:08:40 | 显示全部楼层
本帖最后由 yaner 于 2024-1-15 11:20 编辑

也可以搞成单文件的,两个文件显示图片的位置是.php,表面上图片不能另存。单文件可以直接获取图片在址
发表于 2024-1-15 11:15:46 | 显示全部楼层
  1.         <?php
  2.       $img_array = glob("img/*.{gif,jpg,png}", GLOB_BRACE);
  3.       $img = array_rand($img_array);
  4.       $dz = $img_array[$img];

  5.       list($width, $height) = getimagesize($dz);

  6.       echo '<img src="'.$dz.'" alt="随机图片" style="max-width: 100%; height: auto;">';
  7.     ?>
复制代码


替换掉
  1. <img src="pic.php" style="max-width: 100%; height: auto;">
复制代码


就是单文件了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|免费吧论坛

GMT+8, 2024-7-27 17:32 , Processed in 0.021787 second(s), 3 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表