Home >Web Front-end >CSS Tutorial >css text box and button beautification effect code_Experience exchange

css text box and button beautification effect code_Experience exchange

WBOY
WBOYOriginal
2016-05-16 12:04:582544browse
一、先看看在网页中经常出现的按钮与文本框的本来面目吧!

css text box and button beautification effect code_Experience exchange
  对照上图,我们怎么样才能改变文本框与按钮的模样呢?那在下面我为大家提供两种文本框与按钮样式作为例子参考,第一种是文本框与按钮无立体感,只是有线 条颜色与填充颜色的,这种效果大家可能在很多网站上都看见过,给人一种特别的感觉,很不错的,第二种效果就比较特殊了,是将文本框做成一种类似于下划线的 效果并且是彩色的,同时按钮的背景色也不再是灰色,而是彩色的,可以说这是一种非常酷的效果,好了,下面我就来说说这两种效果实现的详细操作步骤吧。

二、无立体效果的文本框与按钮

  那我们就通过在DW3中网页的编辑操作为例来进行说明,首先我们已经在网页中插入了相应的表单对象,比如插入一个文本框与一个按钮,此时,我们在按下 [F10]键,显示出网页源代码编辑窗口,那我们在网页的与标签之间插入这个样式表:
 

  好了第一步就完成了,下一步我们就分别在文本框与按钮的htm语句中加上这一句代码:
  class=smallInput
  比如在
  
  这个文本框与按钮的htm语句中加入了这句代码。最后的效果如下图:

css text box and button beautification effect code_Experience exchange

  怎么样,比起前面那张图中的标准按钮来说是不是美观多了,要实现起来其实也不是太难吧。

三、带颜色的下划线式文本框与按钮效果

  同样,我们也需要样式表的帮助来实现这个效果,和第一种效果的操作步骤一样在网页的与标签之间插入样式表:

.jb51.net]

As you can see from the style sheet above, this The effect is achieved through two styles, one for the text box and one for the button. Therefore, two different codes need to be inserted into the htm statements of the text box and button. The class inserted in the text box is =smallInput code.
For example, ,
In the button statement, class="buttonface" code is inserted, as in the example

In fact, this corresponds to the style of the text box and button in the style sheet. The final effect is as shown below:

css text box and button beautification effect code_Experience exchange

Look at the above effect, will it remind you of the monotonous text boxes and buttons? ? The above two effects are achieved through style sheets, and the usage methods are also very simple.


The production of forms is the focus of web development. Through forms, interaction and communication can be achieved, and information collection and sharing can also be achieved. The above two articles are carried out from the perspective of semantics and structure. Discussion, you can also participate in the discussion and learning!
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn