php - submit button on hover isn't working -
i'm working on newsfeed , have while loop every posts styles, created an
<input type="submit" name="deletepost" value="delete" class="delete_post" />
and styling isn't working... styling works :hover
isn't working. nor :active
, others. strange.
css
.image_post .user_avatar { width:32px; height:32px; overflow:hidden; border-radius:50%; } .image_post .user_avatar img { width:32px; min-height:32px; } .image_post .user_name { margin-top:7px; color:#fc0096; margin-left:-5px; } .image_post .timeago { color:#999; font-size:10px; position:absolute; top:10px; right:10px; } .image_post img { width:100%; border:1px solid #ccc; } .image_description { width:100%; padding-bottom:8px; background:white; text-align:left; color:#000; margin-top:-10px; } .image_post input[type="submit"] { border:0; position:absolute; top:30px; right:10px; background:black; padding:0; margin:6px 0 0 0; color:#fff; font-size:9px; text-decoration:underline; z-index:999; } .image_post input[type="submit"]:hover { cursor:pointer !important; }
html inside php while loop
<div class="image_post"> <input type="submit" name="deletepost" value="delete" class="delete_post" /> <div class="user_avatar"> <img src="avatars/'.$pica['username'].'.jpeg" /> </div> <div class="user_name">'.$pica['username'].'</div> <br> <br> <br> <br> <div class="timeago">'.$diff.'</div> <div class="image_description">'.$pica['description'].'</div> <img src="upload/'.$pica['name'].'" /> <div class="clear"></div> </div>
i don't understand why :hover
isn't working. take styles normal one, :hover
, :active
etc isn't working. i'm struggling , it's weird, because html/css 2 years, every day. tried lot of possible solutions, sadly... failed. in pencode / jsfiddle failed cursor:pointer ;/
even tho it's weird... try using class .delete_post:hover
on css instead of input[type="submit"]:hover
.
i think should work fine. if not, try placing , id , try id .image_post #delete_post:hover
.
since it's super weird because should work fine... maybe can try jquery , this:
$(document).ready(function(){ $(".delete_post").hover(function(){ $(this).attr("style","cursor:pointer;"); $(this).removeattr("style"); }); });
but again... don't see why :hover
not working you.
Comments
Post a Comment