整合营销服务商

电脑端+手机端+微信端=数据同步管理

免费咨询热线:

如何使用CSS3美化HTML5表单?

现在我们的表单现在我们的表单实现了跨浏览器一致的功能表现,同时也有一些基本样式。你我都知道,使用 CSS3可以让表单的样式更美观。目前我们的表单样式如下:


#redemption {

width: 100%;

font-family: 'ColaborateThinRegular';

font-weight: 400;

}

#redemption hgroup {

argin-bottom: 20px;

}

#redemption div {

width: 100%;

margin-bottom: 15px;

float: left;

}

#redemption span#range {

float: left;

font-size: 3em;

width: 100%;

color: red;

clear: both; text-align: center;

}

#howYouRateThis,#yearOfCrime {

text-align: right;

}

#redemption legend {

font-style: italic;

color: #434242;

font-size: 0.8em;

margin-bottom: 20px;

float: left; width: 100%;

}

#redemption fieldset {

border: 1px dotted #cccccc;

padding: 2%;

margin-bottom: 20px;

}

#redemption label {

width: 40%;

float: left;

}

#redemption input {

height: 20px;

font-size: 1em;

width: 40%;

float: right;

}

#redemption textarea {

height: 60px;

font-size: 1em;

width: 40%;

float: right;

}

#redemption input#submit {

text-decoration: none;

height: 34px;

font: 1.25em /* 36px ÷ 16 */ 'BebasNeueRegular'; background-color: #b01c20;

border-radius: 8px;

color: white; float: right;

margin-bottom: 10px;

background: linear-gradient(top, rgb(241,92,96) 0%, rgb(17 100%);

margin-top: 10px;

box-shadow: 5px 5px 5px hsla(0, 0%, 26.6667%, 0.8);

text-shadow: 0px 1px black;

border: 1px solid #bfbfbf;

.polyfill-important .input-range,.polyfill-important .step-c float: right;

}

.polyfill-important .step-controls {

margin-right: -20px!important;

}

唯一需要注意的地方是最后两个样式只在相应的补丁脚本运行时发挥作用。首先,我想让每个 fieldset都有一个好看的渐变背景,相互之间稍微空开一点。下面是针对 fieldset修改后的 CSS 代码

#redemption fieldset {

border: 1px dotted #cccccc;

padding: 2%;

margin-bottom: 20px;

background: #ffffff; background: linear-gradient(top, #ffffff 77%,#f2f2f2 100%);

border-radius: 4px;

box-shadow: 2px 2px 5px hsla(0, 0%, 16.6667%, 0.3);

}

除了圆角和背景渐变效果,我们唯一需要做的就是再加一点点阴影(box-shadow)效果。 此处省略了各种 CSS3声明的浏览器私有前缀

在整个示例代码中,你可以看到我混用了各种颜色值。有时是 red 这样的颜色名称,有时是十六进制RBGHSL。在支持这些颜色模式的浏览器中这样做没什么问题。但在实际生产环境中,为保持一致性兼容性,你应该只选用一两种颜色模式。

CSS3不仅能轻松地追加样式,而且也能有效阻止在不需要的元素上追加样式。

现在我们的表单现在我们的表单实现了跨浏览器一致的功能表现,同时也有一些基本样式。你我都知道,使用 CSS3可以让表单的样式更美观。目前我们的表单样式如下:


#redemption {

width: 100%;

font-family: 'ColaborateThinRegular';

font-weight: 400;

}

#redemption hgroup {

argin-bottom: 20px;

}

#redemption div {

width: 100%;

margin-bottom: 15px;

float: left;

}

#redemption span#range {

float: left;

font-size: 3em;

width: 100%;

color: red;

clear: both; text-align: center;

}

#howYouRateThis,#yearOfCrime {

text-align: right;

}

#redemption legend {

font-style: italic;

color: #434242;

font-size: 0.8em;

margin-bottom: 20px;

float: left; width: 100%;

}

#redemption fieldset {

border: 1px dotted #cccccc;

padding: 2%;

margin-bottom: 20px;

}

#redemption label {

width: 40%;

float: left;

}

#redemption input {

height: 20px;

font-size: 1em;

width: 40%;

float: right;

}

#redemption textarea {

height: 60px;

font-size: 1em;

width: 40%;

float: right;

}

#redemption input#submit {

text-decoration: none;

height: 34px;

font: 1.25em /* 36px ÷ 16 */ 'BebasNeueRegular'; background-color: #b01c20;

border-radius: 8px;

color: white; float: right;

margin-bottom: 10px;

background: linear-gradient(top, rgb(241,92,96) 0%, rgb(17 100%);

margin-top: 10px;

box-shadow: 5px 5px 5px hsla(0, 0%, 26.6667%, 0.8);

text-shadow: 0px 1px black;

border: 1px solid #bfbfbf;

.polyfill-important .input-range,.polyfill-important .step-c float: right;

}

.polyfill-important .step-controls {

margin-right: -20px!important;

}

唯一需要注意的地方是最后两个样式只在相应的补丁脚本运行时发挥作用。首先,我想让每个 fieldset都有一个好看的渐变背景,相互之间稍微空开一点。下面是针对 fieldset修改后的 CSS 代码

#redemption fieldset {

border: 1px dotted #cccccc;

padding: 2%;

margin-bottom: 20px;

background: #ffffff; background: linear-gradient(top, #ffffff 77%,#f2f2f2 100%);

border-radius: 4px;

box-shadow: 2px 2px 5px hsla(0, 0%, 16.6667%, 0.3);

}

除了圆角和背景渐变效果,我们唯一需要做的就是再加一点点阴影(box-shadow)效果。 此处省略了各种 CSS3声明的浏览器私有前缀

在整个示例代码中,你可以看到我混用了各种颜色值。有时是 red 这样的颜色名称,有时是十六进制RBGHSL。在支持这些颜色模式的浏览器中这样做没什么问题。但在实际生产环境中,为保持一致性兼容性,你应该只选用一两种颜色模式。

CSS3不仅能轻松地追加样式,而且也能有效阻止在不需要的元素上追加样式。

现在我们的表单现在我们的表单实现了跨浏览器一致的功能表现,同时也有一些基本样式。你我都知道,使用 CSS3可以让表单的样式更美观。目前我们的表单样式如下:


#redemption {

width: 100%;

font-family: 'ColaborateThinRegular';

font-weight: 400;

}

#redemption hgroup {

argin-bottom: 20px;

}

#redemption div {

width: 100%;

margin-bottom: 15px;

float: left;

}

#redemption span#range {

float: left;

font-size: 3em;

width: 100%;

color: red;

clear: both; text-align: center;

}

#howYouRateThis,#yearOfCrime {

text-align: right;

}

#redemption legend {

font-style: italic;

color: #434242;

font-size: 0.8em;

margin-bottom: 20px;

float: left; width: 100%;

}

#redemption fieldset {

border: 1px dotted #cccccc;

padding: 2%;

margin-bottom: 20px;

}

#redemption label {

width: 40%;

float: left;

}

#redemption input {

height: 20px;

font-size: 1em;

width: 40%;

float: right;

}

#redemption textarea {

height: 60px;

font-size: 1em;

width: 40%;

float: right;

}

#redemption input#submit {

text-decoration: none;

height: 34px;

font: 1.25em /* 36px ÷ 16 */ 'BebasNeueRegular'; background-color: #b01c20;

border-radius: 8px;

color: white; float: right;

margin-bottom: 10px;

background: linear-gradient(top, rgb(241,92,96) 0%, rgb(17 100%);

margin-top: 10px;

box-shadow: 5px 5px 5px hsla(0, 0%, 26.6667%, 0.8);

text-shadow: 0px 1px black;

border: 1px solid #bfbfbf;

.polyfill-important .input-range,.polyfill-important .step-c float: right;

}

.polyfill-important .step-controls {

margin-right: -20px!important;

}

唯一需要注意的地方是最后两个样式只在相应的补丁脚本运行时发挥作用。首先,我想让每个 fieldset都有一个好看的渐变背景,相互之间稍微空开一点。下面是针对 fieldset修改后的 CSS 代码

#redemption fieldset {

border: 1px dotted #cccccc;

padding: 2%;

margin-bottom: 20px;

background: #ffffff; background: linear-gradient(top, #ffffff 77%,#f2f2f2 100%);

border-radius: 4px;

box-shadow: 2px 2px 5px hsla(0, 0%, 16.6667%, 0.3);

}

除了圆角和背景渐变效果,我们唯一需要做的就是再加一点点阴影(box-shadow)效果。 此处省略了各种 CSS3声明的浏览器私有前缀

在整个示例代码中,你可以看到我混用了各种颜色值。有时是 red 这样的颜色名称,有时是十六进制RBGHSL。在支持这些颜色模式的浏览器中这样做没什么问题。但在实际生产环境中,为保持一致性兼容性,你应该只选用一两种颜色模式。

CSS3不仅能轻松地追加样式,而且也能有效阻止在不需要的元素上追加样式。