开发者

HTML, eliminate box with input 'submit'

How do I eliminate the 'button' in my input field? I want to use an image, but the box still appears.

Thanks,

<!DOCTYPE html PUBLIC "">
<head>
<style>
#PlusMinus{background:url('images/sprites.gif') 0px -391px;left:0px;width:13px;}
#PlusMinus a:hover{background: url('images/sprites.gif') 0px -406px;}
</style>

<script type="text/javascript" src开发者_Python百科="js/jquery-1.4.min.js"></script>
<script type='text/javascript'>
    var fontSizes = [14, 16]
    $(function(){
      $('#PlusMinus').click(function() {
        if($(this).val() == "+") {
            $('#OurText').css('fontSize', fontSizes[1] + 'px');
        $(this).val("-");
        }
        else {
        $('#OurText').css('fontSize', fontSizes[0]+ 'px');
        $(this).val("+");
    }
       $("body .h6").toggle();
    });
});
</script>
</head>
<body>
    <h6 class="noSpan">
      <!--HERE'S THE INPUT-->
      <input 'submit' id='PlusMinus' />
      <span class="h6">Larger</span>
      <span class="h6" style="display: none">Smaller</span>
    </h6>
    <h5 id="OurText" class="p">TEXT</h5>
</body>
</html>

I've used input 'submit, image, and button', and still get this box

input 'submit' id='PlusMinus'


<input type="image" src="[path]" />

you need the "type" attribute


Try setting the background to none, the border to none and the background color to none.

#PlusMinus{
background: none;
background-color: none;
border: none;
background-image: URL(../images/yourimage.jpg) no-repeat;
}

You can then also set the height and width to this element to make it fit your background image perfectly.

Also make sure to use the type setting for the input you want

type="button" type="submit"

et cetera

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜