abstrak:<!DOCTYPE html> <html> <head> <title></title> <script type="text/javascript" src="http://apps.b
<!DOCTYPE html> <html> <head> <title></title> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.0.0/jquery.min.js"></script> <style> .div { width: 90%; height: 20px; background-color: blue; display: inline-block; } span { width:6%; height: 20px; line-height: 20px; display: inline-block; } </style> <script> function a(num){ var len = document.getElementsByClassName(num).length for(var i =0; i<len; i++){ document.getElementsByClassName(num)[i].style.backgroundColor = 'rgb('+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+')' } } $(document).ready(function(){ a('div') $('.div').mouseenter(function(){ $(this).animate( { width:Math.random()*90+'%' },1000) }) $('.div').mouseleave(function(){ $(this).animate( { width:'90%' },1000) }) }) </script> </head> <body> <div> <span>html</span> <div class="div"></div> </div> <br> <div> <span>JavaScript</span> <div class="div"></div> </div> <br> <div> <span>jQuery</span> <div class="div"></div> </div> <br> <div> <span>php</span> <div class="div"></div> </div> </body> </html>
通過最近做案例總結(jié),html還是css邏輯還是非常重要,在寫樣式的時候不是因為不知道代碼怎么寫,而是上下層關(guān)系比較亂
Guru membetulkan:韋小寶Masa pembetulan:2019-01-07 09:09:59
Rumusan guru:對于樣式不清楚怎么寫還是因為你寫少了 或者是你對課程中講的知識還沒理解透徹 課后記得要多復(fù)習(xí)和練習(xí)