我正在为我的网站使用 bitrepository 的 Ajax PHP 表单,并使用他们的 CSS 样式表对其进行样式设置。请访问http://diginnovations.com/dig-v4查看该站点。
除 Firefox 3.6 外,所有浏览器(甚至 IE8)都能正确显示。“评论”一词显示在文本区域之外,它也在错误的位置。我使用“位置:相对;” 为了移动文本区域并提交按钮。
这是PHP代码:
$acf_form_fields = array('sender_name' => array('name' => 'Name',
'mandatory' => 1,
'validation' => array('basic' => 1),
'type' => 'input',
'errors' => array('none' => 'Fill your name')),
'sender_email' => array('name' => 'Email',
'mandatory' => 1,
'validation' => array('basic' => 1, 'email' => 1),
'type' => 'input',
'errors' => array('none' => 'Fill an e-mail address',
'invalid' => 'Fill a valid e-mail address')),
'sender_telephone' => array('name' => 'Phone Number',
'mandatory' => 0,
'type' => 'input'),
'sender_message' => array('name' => '<div class="textbox">Comment</div>',
'mandatory' => 1,
'validation' => array('basic' => 1, 'min_chars' => 15),
'type' => 'textarea',
'attributes' => array('rows' => 5,
'cols' => 35),
'errors' => array('none' => '<div class="textboxerror">Fill your message</div>',
'min_chars' => 'Your message should have at least [min_chars] characters.')));
这是CSS:
/* Label, Input, Textarea */
#ajax_contact_form div.wrap { position: relative; margin: 0;}
#acf_fields div.wrap label.in_field { position: absolute; top: 0; left: 0; width: 160px; display: block; margin: 11px 5px 5px 6px; padding: 0; color: #777; }
#ajax_contact_form div br {display: none;}
#acf_fields div { padding: 1px 0 1px 0px; }
#acf_fields div input { display: inline; font-size: 17px; }
#acf_fields div textarea { position: relative; left: 300px; bottom: 150px; font-size: 17px; display: inline; }
#acf_fields p.acf_escts { padding: 5px 0; }
#acf_fields label.acf_escts { width: 199px; padding-left: 0px; margin: 2px 17px 5px 0px; text-align: right; float: none; }
/* Input, Textarea, Select */
#acf_fields input, textarea, select { -moz-box-shadow: 0 0 3px #eeeeee; background:-moz-linear-gradient(top, #ffffff, #eeeeee 1px, #ffffff 5px); margin: 5px 5px 5px 0; padding: 2px; height: 30px; width: 269px; }
#acf_fields input, select { float: none; border: 2px solid #999; color: #333; -moz-border-radius: 3px; }
#acf_fields textarea { position: relative; left: 300px; bottom: 150px; width: 269px; height: 130px; border: 2px solid #999; color: #333; -moz-border-radius: 3px; }
.textbox { position: relative; left: 300px; bottom: 150px; display: inline; z-index: 150; }
.textboxerror { position: relative; left: 300px; bottom: 150px; display: inline; z-index: 150; }
显然,如果我将它们移动到 FF 3.6 中正确显示,它会打乱所有其他浏览器的定位。
有什么建议么?提前致谢。