私はコーディングが初めてで、すべてのブラウザーでページを正しく表示するのに問題があります。現在、IE で完全に動作しますが、Firefox や Chrome で開くと書式設定が失われます。
これは私が使用しているコードの抜粋です:
<style type="text/css">
#headerIMG {
padding:0;
margin:0;
margin-bottom:15px;
width:100%;
}
label {
padding-right:10px;
text-align:left;
{
table {
width: 580px;
margin: 0 auto;
text-align: center;
align: center;
}
.centerspacer {
width:50%;
}
tr {
width: 580px;
margin: 0 px;
}
td {
padding:5px;
}
.center {
text-align:center;
}
.button {
float:none;
display:block;
margin: 10px auto;
text-align:center;
}
form {
width: 580px;
margin: 0 auto;
}
.rectbcontent {
width: 580px;
margin: 0 auto;
text-align:center;
}
table.tbody {
width: 580px;
margin: 0 auto;
}
</style>
<form action="https://test.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name="oid" value="00DK0000005Iu4O">
<input type=hidden name="retURL" value="http://www.vela-ins.com">
<table class="tbody">
<tr>
<td class="centerspacer"> </td>
<td><label for="first_name">First Name</label></td>
<td><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /> </td>
<td class="centerspacer"> </td>
</tr>
<tr>
<td class="centerspacer"></td>
<td><label for="last_name">Last Name</label></td>
<td><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /></td>
<td class="centerspacer"> </td>
</tr>
<tr>
<td class="centerspacer"></td>
<td><label for="email">Email</label></td>
<td><input id="email" maxlength="80" name="email" size="20" type="text" /></td>
<td class="centerspacer"> </td>
</tr>
<tr>
<td class="centerspacer"></td>
<td><label for="phone">Phone</label></td>
<td><input id="phone" maxlength="15" name="phone" size="20" type="text" /></td>
<td class="centerspacer"> </td>
</tr>
<tr>
<td class="centerspacer"></td>
<td><label for="company">Company</label></td>
<td><input id="company" maxlength="40" name="company" size="20" type="text" /></td>
<td class="centerspacer"> </td>
</tr>
<tr>
<td class="centerspacer"></td><td>
<label for="city">City</label></td>
<td><input id="city" maxlength="40" name="city" size="20" type="text" /></td>
<td class="centerspacer"></td>
</tr>
<tr>
<td class="centerspacer"></td>
<td><label for="state">State/Province</label></td><td><input id="state" maxlength="20" name="state" size="20" type="text" /></td><td class="centerspacer"></td>
</tr>
</table>
</select>
</form>
<script>
var x = 'https://images.wrberkley.com/imageserver/WRBTS/VELA/site/images/';
var assignrule;
var imageURL;
var lob = getQueryVariable('product');
lob = lob.toLowerCase().charAt(0);
switch (lob)
{
//change this case to look at first character for construction
case 'c':
imageURL=x + 'Headlines/constructionheader.png';
assignrule='Construction';
break;
case 'm':
imageURL=x + 'Headlines/manufacturingheader.png';
assignrule="Manufacturing";
break;
case 'p':
imageURL=x + 'Headlines/professionalliabilityheader.png';
assignrule="Professional Liability";
break;
case 'g':
imageURL=x + 'Headlines/generalcasualtyheader.png';
assignrule="General Casualty";
break;
default:
imageURL=x + 'header.png';
assignrule="default";
}
document.getElementById('headerIMG').src = imageURL
document.getElementById("00NK0000000Yqv2").value = assignrule;
</script>