用HTML-CSS创建一个属于自己的个人网页

效果图:(融入了音频与视频元素)


 

 html代码(首次制作,多多见谅)

  • <!DOCTYPE html >
    <html >
    <head>  
    
    <title>我的网页</title>  
    <link href="1.css" rel="stylesheet" type="text/css">
    
    </head>
     
    <body  bgcolor ="lightblue">
    <table width="100%" border="5" cellpadding="5" cellspacing="0" >
      <tr>
        <td><img src="图3.png"  height="100" /></td>
        <td width="100" align="center"><a href="w1.html">主页</a></td>
        <td width="100" align="center"><a href="w2.html">我的</a></td>
        <td width="100" align="center"><a href="w3.html">相册</a></td>
        <td width="100" align="center"><a href="w4.html">日志</a></td>
        <td width="100" align="center"><a href="w0.html">音乐</a></td>
      </tr>
    </table>
    
    <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
    
    <tr>
           
            <td>
    	    <p >我的个人简介。 </p>
              <p >姓名:wj</p>
              <p >性别:男</p>
              <p >生日:0809</p>
              <p >学校:某某大学</p>
              <p >爱好:摄影,乒乓球,学习,王者荣耀</p></td>
             <td>
    		<td/>
    		<img src="图4.png" width="400">
           </td>
    
    
    
    </tr>
    
    
      
    
      
    <tr>
            <td><img src="图1.png" width="400" /></td>
            <td>
              <p >我不太温柔,但对于你,我尽我所能 </p>
              <p > 我会一直爱你,你可以反复想我确认</p>
              <p >没关系,我不听他们说,我听你说 </p>
              <p > 乖,待着别动,我来找你</p>
              <p > 不忙,你说,我在听</p>
            </td>
     </tr>
    
    
     <tr>
            <td>
    	<p>歌曲——起风了</p>
    	<audio  color="green"  autoplay="autoplay" id="audio" loop="loop" 	preload="auto" controls="pausebutton" >   
     	<source src="起风了 (DJ版).mp3" type="audio/MP3"  >  
         </audio>
    
    	</td>
    	<td/>
          <td>
    	<p>视频——吹梦到西洲</p>
    	<video controls  width="400" src="吹梦到西洲.mp4">
        	</video>
    
    	</td>
    </tr>
    
    
    
      
    </table>
    </body>
    </html>
  • p {
        color:green ;
        text-align: center;
      }
    
    
    
    
    
    body{
                    /* 加载背景图片 */
    				background-image: url(图5.png);
    				/* 背景图垂直、水平均居中 */
    				background-position: center center;
                    /* 背景图不平铺 */
                    background-repeat: no-repeat;
                    /* 当内容高度大于图片高度时,背景图像的位置相对于viewport固定 */
                    background-attachment: fixed;  /*此条属性必须设置否则可能无效*/
                    /* 让背景图基于容器大小伸缩 */
                    background-size: cover;
    			}
    
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
以下是一个简单的动态网页特效,用HTMLCSS和JS实现。页面背景有动态的星空效果,同时有一些祝福语和动态的加油口号。希望对你有帮助! HTML代码: ``` <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>高考加油!</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="stars"></div> <div class="container"> <h1>高考加油!</h1> <p>亲爱的高考考生们:</p> <p>今天是你们人生中的重要一天!</p> <p>你们经过了长达三年的努力,终于迎来了高考这个关键的时刻。</p> <p>无论成绩如何,你们都是优秀的,都值得尊重和骄傲。</p> <p>无论你们的未来道路如何,都希望你们能够保持乐观、坚强、自信的态度,勇敢地面对未来的挑战。</p> <p>最后,祝愿你们都能够取得优异的成绩,实现自己的梦想!</p> <p>高考加油!</p> <div class="slogan"> <h2>每个人都有自己的天空</h2> <h2>高考加油,飞向属于你的星空!</h2> </div> </div> <script src="script.js"></script> </body> </html> ``` CSS代码: ``` * { box-sizing: border-box; margin: 0; padding: 0; } body { background-color: black; color: white; font-family: Arial, sans-serif; text-align: center; } .stars { background-image: url(stars.png); background-repeat: repeat; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: -1; } .container { margin-top: 50px; } h1 { font-size: 48px; margin-bottom: 20px; } p { font-size: 24px; margin-bottom: 10px; line-height: 1.5; } .slogan { margin-top: 50px; } .slogan h2 { font-size: 36px; margin-bottom: 10px; } .slogan h2:last-child { animation: blink 2s infinite; } @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } } ``` JS代码: ``` // 生成随机星星 function generateStars() { var count = 100; var stars = document.querySelector('.stars'); for (var i = 0; i < count; i++) { var star = document.createElement('div'); var x = Math.floor(Math.random() * window.innerWidth); var y = Math.floor(Math.random() * window.innerHeight); var size = Math.floor(Math.random() * 3) + 1; var duration = Math.floor(Math.random() * 10) + 5; star.classList.add('star'); star.style.left = x + 'px'; star.style.top = y + 'px'; star.style.width = size + 'px'; star.style.height = size + 'px'; star.style.animationDuration = duration + 's'; stars.appendChild(star); } } generateStars(); ``` 在同一目录下,需要创建以下文件: - `stars.png`:星星背景图; - `style.css`:CSS文件; - `script.js`:JS文件。 由于无法在此处上传图片和文件,因此无法直接演示该动态网页特效。如果想要查看效果,可以新建一个HTML文件,将上述代码复制到文件中,并将相关文件放置在同一目录下。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

YBZJ&奕

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值