jquery - 如何为按钮添加悬停效果?

标签 jquery css html twitter-bootstrap

谁能帮帮我。我真的需要为我创建的 img 按钮创建一个按钮效果。是否有 css 解决方案,我是否需要创建其他按钮?我希望任何人都可以帮助我,因为我真的需要一个效果。

<html><head>  

    <title>Mobiel</title>

    <meta name="viewport" content="width=device-width, initial-scale=1.0"><!-- Bootstrap -->  

    <link href="css\bootstrap.min.css" rel="stylesheet" media="screen">  
    <link rel="stylesheet" href="css\styles_responsive.css" type="text/css" media="screen" title="no title" charset="utf-8">
    <style>  
    body {  
    padding: 50px  
    }  
    </style><!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --><!-- WARNING: Respond.js doesn't work if you view the page via file:// --><!--[if lt IE 9]>  
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>  
      <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>  
    <![endif]-->  


<script>
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
  var msViewportStyle = document.createElement("style");
  msViewportStyle.appendChild(
    document.createTextNode(
      "@-ms-viewport{width:auto!important}"
    )
  );
  document.getElementsByTagName("head")[0].
    appendChild(msViewportStyle);
}
</script>

  <style>
 .navbar {
 position: left;    
 overflow: visible;   
 padding-top: 0;
 }   
 </style>
 <style type="text/css">
li{list-style-type:none;float:left;}
 a{text-align:center}
</style>

</head>  
  <body>  

 <div class="navbar navbar-fixed-top">
   <div class="navbar-inner">
     <div class="container">

<img src="img\Logo_helpen.jpg" alt="Logo"></div></div></div>
<p>
</p><p>
</p><p>
<br>
<a href="#"><img src="img\hoe-werkt-het.png" alt="Hoe werkt het?" name="Hoe werkt het?" class="img-rounded">&nbsp;&nbsp;&nbsp;&nbsp;</a>
<a href="search\index.html"><img src="img\smoelenboek.png" alt="image with rounded corners" class="img-rounded">&nbsp;&nbsp;&nbsp;&nbsp; 
<a href="alert\alert.html"><img src="img\aagje-alert.png" alt="image with rounded corners" class="img-rounded"></a></p><p>
<small>Hoe werkt&nbsp; &nbsp;&nbsp; Smoelenboek &nbsp; &nbsp;Aagje Alert <br>&nbsp; &nbsp; &nbsp; het? &nbsp;&nbsp;&nbsp;</small><br>
<img src="img\alert.jpg" alt="image with rounded corners" class="img-rounded">&nbsp;&nbsp;&nbsp;&nbsp; 
<img src="img\alert.jpg" alt="image with rounded corners" class="img-rounded">&nbsp;&nbsp;&nbsp;&nbsp;
<img src="img\alert.jpg" alt="image with rounded corners" class="img-rounded"></a></p>
<br><a href="#">
<img src="img\alert.jpg" alt="image with rounded corners" class="img-rounded">&nbsp;&nbsp;&nbsp;&nbsp;
<img src="img\alert.jpg" alt="image with rounded corners" class="img-rounded">&nbsp;&nbsp;&nbsp;&nbsp; 
<img src="img\alert.jpg" alt="image with rounded corners" class="img-rounded"></a><p><a href="#">  


<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->  
   <script src="https://code.jquery.com/jquery.js"></script>  
  <!-- Include all compiled plugins (below), or include individual files as needed -->  
    <script src="js\bootstrap.min.js"></script>     
 </a></p></body></html>

最佳答案

要在悬停时更改元素的 CSS 属性,请在 CSS 中使用 :hover

a .img-rounded:hover {
    /* CSS here */
}

关于jquery - 如何为按钮添加悬停效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24331300/

相关文章:

javascript - 如何简化长的 javascript switch case 语句?

javascript - 没有 jQuery 的 jQuery 实时功能

html - 如何创建投影?

javascript - 使用 jquery 动态创建下拉菜单不起作用

html - 使用 HTML anchor 标记后内容隐藏在标题后面

jquery - 将一些对象添加到父级,它是具有相似 ID 的 DIV 之一

javascript - 检查日期是否在过去而不提交表格

jquery - 滚动时修复导航菜单

php - 将 css 添加到表单

php - 将样式从 PHP 移动到头部