css实现input 输入框背景透明源码

20 篇文章 0 订阅

为了让带背景颜色的表单页面更美观,有时候需要把input 输入框设置成透明的背景,实现这种效果,需要在input 添加输入框属性:"background-color:transparent"
<input style="background-color:transparent" type="text" name="name"> (有边框)
<input style="background-color:transparent; border-width:1;"> (细边框)
<input   style="background-color:   transparent;   border:   0px"> (无边框)

 

 

 

本篇文章来源于 我爱编程网 :http://www.bcw52.com/Article/2014.html

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
登录窗口是网页设计中经常需要用到的一个元素,它通常用来实现登录认证的功能。在HTMLCSS中,我们可以用一些基本的标记和属性来创建一个简单的登录窗口。 首先,在HTML中,我们可以使用form标签来创建一个表单,用来接收用户的输入数据。在表单中,我们可以使用input标签来创建输入框,用来让用户输入用户名和密码。可以定义type属性为“text”和“password”分别对应输入账号和密码。 然后,我们可以在表单里使用一个按钮来实现登录操作。按钮可以使用input标签中的type属性来设置button,name属性来定义按钮的名称,value属性来定义按钮上显示的文本。 接下来,我们可以使用CSS来美化登录窗口。我们可以为表单元素设置边框、背景色等样式,通过设置text-align:center; 实现表单元素水平居中。我们也可以用hover属性来实现鼠标悬停的状态变化,比如当鼠标悬停在登录按钮上,我们可以用background-color:#f1356d; 给按钮设置一个红色的背景色。 在CSS中还可以使用一些布局技巧,比如flex布局、grid布局等,来实现登录窗口的更加复杂的排版布局。 下面是一个简单的登录窗口的htmlCSS代码: HTML CODE: ``` <form> <label for="username">用户名</label> <input type="text" id="username" name="username" required> <label for="password">密码</label> <input type="password" id="password" name="password" required> <input type="submit" value="登录"> </form> ``` CSS CODE: ``` form { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 300px; height: 300px; margin: 50px auto; padding: 20px; border: 1px solid #ccc; background-color: #eee; } label, input[type="submit"] { margin: 10px 0; } input[type="text"], input[type="password"], input[type="submit"] { width: 100%; height: 30px; line-height: 30px; text-align: center; border: none; border-radius: 5px; } input[type="submit"] { background-color: #4CAF50; color: white; cursor: pointer; transition: all 0.3s ease-in-out; } input[type="submit"]:hover { background-color: #f1356d; } ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值