zoukankan      html  css  js  c++  java
  • 页面html图片按钮多种写法

    原地址:http://blog.163.com/weison_hi/blog/static/17680404720118534033788/

    第一种: 在一般情况下按钮提交表单:

         <form id="form1" name="form1" method="post" action="index.html">
      <input type="submit" name="button" id="button" value="提交" />
       </form>

    这样提交按钮是标签 <input type="submit">,如果想换成图片加上样式,把value="提交" 改成value=" "(这样“提交”两个字就不会显示在这张背景图片的上面):

      #button{
     background:url(eeo_2.jpg) no-repeat;
     100px;
     height:50px;
     border:0px;
     cursor:pointer;
      }

    第二种:直接使用图片标签按钮

    <form id="form1" name="form1" method="post" action="index.html">
      <input name="submit" type="image" value="ee" src="eeo_2.jpg" />
    </form>

    这样子直接写在html页面上就能直接看到按钮是图片的!

     

    第三种:由于上面第二种图片直接使用 “src”链接,但是如果一个网站很多需要到表单图片按钮展示的话,这样就会增加网页显示的速度!之前说过如果把全部类型差不多的图片整合成一张,每个页面使用css+div调用同一张图片里面的不同个按钮图标图片,这样的话便能更优化代码以及网站。

    <form id="form1" name="form1" method="post" action="index.html">
      <input name="submit" type="image" value="ee" src="eeo_2.jpg" />
    </form>
    样式:

    button{
     background:url(eeo_2.jpg) no-repeat -54px -35px;
     100px;
     height:50px;
     border:0px;
     cursor:pointer;
     }

  • 相关阅读:
    hadoopnamenode配置及问题处理方案
    hadoop 运行 Java程序
    hadoop命令大全
    DOS
    腾讯Linux QQ安装
    linux下安装realplayer
    在linux中配置安装telnet服务
    关于C#静态构造函数的几点说明
    linux下的Network File Server共享配置
    Oracle学习笔记
  • 原文地址:https://www.cnblogs.com/alana/p/3533368.html
Copyright © 2011-2022 走看看