2017-06-22 21 views
0

私は電子メールの署名作成者に取り組んでいます。私は自分のラジオボタンを作っています(私は普通のものに似ていません)。私はthis postに基づいています。私はそれらを似たように見せて、多かれ少なかれコピーして、同じ結果を得たいと思っています。私は少しサイズを変更し、それらの機能と一緒に遊んだと私はこれを得た:Radio Buttons。私は彼らの姿が好きですが、一緒に近づいています。あなたは間違いなくあなたはそれの残りの部分を見るとことがわかります。カスタムラジオボタンが正しく配置されていません

Rest of picture

あなたが見ることができるように、ボタンが一緒にあまりにも接近しています。私は彼らが少し離れていることを望んでいる(しかし、私はそれらが欲しい)が、rightmargin-rightなどを試してみると、それらの背後にある実際の退屈な古い入力を明らかにした。

アイデア?ここでは、プログラム全体のための私のコードは、これまでのところです:

$(function() { 
 
    $("#editorTextInfoName").keyup(function() { 
 
    var infoNameTextValue = $("#editorTextInfoName").val(); 
 
    $("#fullName").text(infoNameTextValue); 
 
    }); 
 
    $("#editorTextInfoJob").keyup(function() { 
 
    var infoJobTextValue = $("#editorTextInfoJob").val(); 
 
    $("#jobText").text(infoJobTextValue); 
 
    }); 
 
});
table { 
 
    display: inline-block; 
 
} 
 
#image { 
 
    width: 125px; 
 
    height: 125px; 
 
    border-radius: 50%; 
 
    margin-top: -45px; 
 
} 
 
.spacer { 
 
    width: 15px; 
 
} 
 
hr { 
 
    height: 200px; 
 
    width: 7.5px; 
 
    border-radius: 20px; 
 
    border: none; 
 
    background-color: cornflowerBlue; 
 
} 
 
#fullName { 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    font-size: 24px; 
 
    color: orange; 
 
    margin-top: -40px; 
 
    } 
 
#job { 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    font-size: 18px; 
 
    margin-top: -10px; 
 
    } 
 
#jobLocationText { 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    font-size: 16px; 
 
    margin-top: -10px; 
 
} 
 
.otherText { 
 
    color: seaGreen; 
 
} 
 
#emailAddress, #phoneNumber, #officePhoneNumber, #address, #website { 
 
    font-size: 17px; 
 
} 
 
#extra1, #extra2, #extra3, #extra4, #extra5, #extra6 { 
 
    white-space: pre-wrap; 
 
} 
 
#signatureEditorText { 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    font-size: 24px; 
 
    margin-bottom: 40px; 
 
} 
 
.editorTextInfo { 
 
    color: gray; 
 
    font-family: 'Lato', sans-serif; 
 
    font-size: 18px; 
 
    margin-bottom: 7px; 
 
    margin-right: 60px; 
 
} 
 
.editorTextBox { 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    margin-right: 60px; 
 
    margin-bottom: 20px; 
 
    font-size: 16px; 
 
    height: 20px; 
 
    width: 160px; 
 
    border: 2px solid darkGray; 
 
    border-radius: 6px; 
 
} 
 
.editorTextBox:focus { 
 
    outline: 0; 
 
} 
 
input[type = "radio"]:after { 
 
    width: 25px; 
 
    height: 25px; 
 
    border-radius: 50%; 
 
    top: -12px; 
 
    right: 6px; 
 
    margin-right: 50px; 
 
    background-color: darkGray; 
 
    content: ""; 
 
    position: relative; 
 
    display: inline-block; 
 
} 
 
input[type = "radio"]:hover { 
 
    cursor: pointer; 
 
} 
 
input[type = "radio"]:checked:after { 
 
    width: 25px; 
 
    height: 25px; 
 
    border-radius: 50%; 
 
    background-color: orange; 
 
    top: -12px; 
 
    right: 6px; 
 
    content: ""; 
 
    position: relative; 
 
    display: inline-block; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<!DOCTYPE html> 
 
<html> 
 
    <head> 
 
     <meta charset="utf-8"> 
 
     <meta name="viewport" content="width=device-width"> 
 
     <link rel="icon" href="Logo.ico"> 
 
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> 
 
     <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet"> 
 
     <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet"> 
 
     <title>HTML Hub</title> 
 
     <link href="index.css" rel="stylesheet" type="text/css"/> 
 
    </head> 
 
    <body> 
 
     <center> 
 
     <table cellpadding="0" cellspacing="0" border="0" style="background: none; border-width: 0px; border: 0px; margin: 0; padding: 0;"> 
 
      <tr> 
 
      <td> 
 
       <center> 
 
       <img src="https://vignette2.wikia.nocookie.net/mafiagame/images/2/23/Unknown_Person.png/revision/latest?cb=20151119092211" id="image" title="Picture to be displayed"> 
 
       </center> 
 
      </td> 
 
      <td class="spacer"></td> 
 
      <td rowspan="4"> 
 
       <hr> 
 
      </td> 
 
      <td class="spacer"></td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <center> 
 
       <div id="fullName">Billy Staples</div> 
 
       </center> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <center> 
 
       <div id="job"><i id = "jobText">Programmer</i></div> 
 
       </center> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <center> 
 
       <div id="jobLocationText">at <b id="jobLocation">My Company</b></div> 
 
       </center> 
 
      </td> 
 
      </tr> 
 
     </table> 
 
     <table id="contactInfo" cellpadding="0" cellspacing="0" border="0" style="background: none; border-width: 0px; border: 0px; margin: 0; padding: 0;"> 
 
      <tr> 
 
      <td> 
 
       <div id="emailAddress"><span class="otherText">Email: </span><span id="emailAddressText">[email protected]</span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="phoneNumber"><span class="otherText">Phone: </span><span id="phoneNumberFirst">111</span>-<span id="phoneNumberSecond">222</span>-<span id="phoneNumberThird">3333</span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="officePhoneNumber"><span class="otherText">Office Phone: </span><span id="officePhoneNumberFirst">444</span>-<span id="officePhoneNumberSecond">555</span>-<span id="officePhoneNumberThird">6666</span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="address"><span class="otherText">Address: </span><span id="addressText">1379 Philadelphia Avenue</span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="website"><span class="otherText">Website: </span><span id="websiteText">example.com</span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="extra1"><span class="otherText" id="extra1Label"></span><span id="extra1Text"> </span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="extra2"><span class="otherText" id="extra2Label"></span><span id="extra2Text"> </span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="extra3"><span class="otherText" id="extra3Label"></span><span id="extra3Text"> </span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="extra4"><span class="otherText" id="extra4Label"></span><span id="extra4Text"> </span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="extra5"><span class="otherText" id="extra5Label"></span><span id="extra5Text"> </span></div> 
 
      </td> 
 
      </tr> 
 
     </table> 
 
     </center> 
 
     &nbsp; 
 
     <p></p> 
 
     <table id = "editTable" cellpadding="0" cellspacing="0" border="0" style="background: none; border-width: 0px; border: 0px; margin: 0; padding: 0;"> 
 
      <tr> 
 
      <td> 
 
       <div id = "signatureEditorText">Signature Editor</div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div class = "editorTextInfo">Name</div> 
 
      </td> 
 
      <td> 
 
       <div class = "editorTextInfo">Job</div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <input id = "editorTextInfoName" type = "text" class = "editorTextBox"> 
 
      </td> 
 
      <td> 
 
       <input id = "editorTextInfoJob" type = "text" class = "editorTextBox"> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div class = "editorTextInfo">Company</div> 
 
      </td> 
 
      <td> 
 
       <div class = "editorTextInfo">At/At the</div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <input id = "editorTextInfoCompany" type = "text" class = "editorTextBox"> 
 
      </td> 
 
      <td> 
 
       <input name = "radio" id = "editorRadioInfoCompany1" type = "radio" class = "editorRadio"> 
 
       <input name = "radio" id = "editorRadioInfoCompany2" type = "radio" class = "editorRadio"> 
 
      </td> 
 
      </tr> 
 
     </table> 
 
    </body> 
 
</html>

ありがとう!いくつかのマージン、解決する必要があります。

+0

なぜ私は* at/at *のラジオボタンを持っているのかについての詳細は、いくつかの時間は*空白で*作業しているかもしれないので*空白で*働くかもしれないからです。 – CyanCoding

+0

入力ラジオのマージンを試しましたか? – XYZ

+0

しました。私は質問の中で、それを右に動かすために「margin-right」を使って試したことを言ったと思います。 – CyanCoding

答えて

1

以下に見られるように、ラジオボタンのコードの間& NBSPを追加しますが、入力自体を与える(要素「後」ではない)

$(function() { 
 
    $("#editorTextInfoName").keyup(function() { 
 
    var infoNameTextValue = $("#editorTextInfoName").val(); 
 
    $("#fullName").text(infoNameTextValue); 
 
    }); 
 
    $("#editorTextInfoJob").keyup(function() { 
 
    var infoJobTextValue = $("#editorTextInfoJob").val(); 
 
    $("#jobText").text(infoJobTextValue); 
 
    }); 
 
});
table { 
 
    display: inline-block; 
 
} 
 
#image { 
 
    width: 125px; 
 
    height: 125px; 
 
    border-radius: 50%; 
 
    margin-top: -45px; 
 
} 
 
.spacer { 
 
    width: 15px; 
 
} 
 
hr { 
 
    height: 200px; 
 
    width: 7.5px; 
 
    border-radius: 20px; 
 
    border: none; 
 
    background-color: cornflowerBlue; 
 
} 
 
#fullName { 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    font-size: 24px; 
 
    color: orange; 
 
    margin-top: -40px; 
 
    } 
 
#job { 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    font-size: 18px; 
 
    margin-top: -10px; 
 
    } 
 
#jobLocationText { 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    font-size: 16px; 
 
    margin-top: -10px; 
 
} 
 
.otherText { 
 
    color: seaGreen; 
 
} 
 
#emailAddress, #phoneNumber, #officePhoneNumber, #address, #website { 
 
    font-size: 17px; 
 
} 
 
#extra1, #extra2, #extra3, #extra4, #extra5, #extra6 { 
 
    white-space: pre-wrap; 
 
} 
 
#signatureEditorText { 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    font-size: 24px; 
 
    margin-bottom: 40px; 
 
} 
 
.editorTextInfo { 
 
    color: gray; 
 
    font-family: 'Lato', sans-serif; 
 
    font-size: 18px; 
 
    margin-bottom: 7px; 
 
    margin-right: 60px; 
 
} 
 
.editorTextBox { 
 
    font-family: 'Source Sans Pro', sans-serif; 
 
    margin-right: 60px; 
 
    margin-bottom: 20px; 
 
    font-size: 16px; 
 
    height: 20px; 
 
    width: 160px; 
 
    border: 2px solid darkGray; 
 
    border-radius: 6px; 
 
} 
 
.editorTextBox:focus { 
 
    outline: 0; 
 
} 
 
input[type = "radio"]:after { 
 
    width: 25px; 
 
    height: 25px; 
 
    border-radius: 50%; 
 
    top: -12px; 
 
    right: 6px; 
 
    margin-right: 50px; 
 
    background-color: darkGray; 
 
    content: ""; 
 
    position: relative; 
 
    display: inline-block; 
 
} 
 
input[type = "radio"]:hover { 
 
    cursor: pointer; 
 
} 
 
input[type = "radio"]:checked:after { 
 
    width: 25px; 
 
    height: 25px; 
 
    border-radius: 50%; 
 
    background-color: orange; 
 
    top: -12px; 
 
    right: 6px; 
 
    content: ""; 
 
    position: relative; 
 
    display: inline-block; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<!DOCTYPE html> 
 
<html> 
 
    <head> 
 
     <meta charset="utf-8"> 
 
     <meta name="viewport" content="width=device-width"> 
 
     <link rel="icon" href="Logo.ico"> 
 
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> 
 
     <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet"> 
 
     <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet"> 
 
     <title>HTML Hub</title> 
 
     <link href="index.css" rel="stylesheet" type="text/css"/> 
 
    </head> 
 
    <body> 
 
     <center> 
 
     <table cellpadding="0" cellspacing="0" border="0" style="background: none; border-width: 0px; border: 0px; margin: 0; padding: 0;"> 
 
      <tr> 
 
      <td> 
 
       <center> 
 
       <img src="https://vignette2.wikia.nocookie.net/mafiagame/images/2/23/Unknown_Person.png/revision/latest?cb=20151119092211" id="image" title="Picture to be displayed"> 
 
       </center> 
 
      </td> 
 
      <td class="spacer"></td> 
 
      <td rowspan="4"> 
 
       <hr> 
 
      </td> 
 
      <td class="spacer"></td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <center> 
 
       <div id="fullName">Billy Staples</div> 
 
       </center> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <center> 
 
       <div id="job"><i id = "jobText">Programmer</i></div> 
 
       </center> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <center> 
 
       <div id="jobLocationText">at <b id="jobLocation">My Company</b></div> 
 
       </center> 
 
      </td> 
 
      </tr> 
 
     </table> 
 
     <table id="contactInfo" cellpadding="0" cellspacing="0" border="0" style="background: none; border-width: 0px; border: 0px; margin: 0; padding: 0;"> 
 
      <tr> 
 
      <td> 
 
       <div id="emailAddress"><span class="otherText">Email: </span><span id="emailAddressText">[email protected]</span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="phoneNumber"><span class="otherText">Phone: </span><span id="phoneNumberFirst">111</span>-<span id="phoneNumberSecond">222</span>-<span id="phoneNumberThird">3333</span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="officePhoneNumber"><span class="otherText">Office Phone: </span><span id="officePhoneNumberFirst">444</span>-<span id="officePhoneNumberSecond">555</span>-<span id="officePhoneNumberThird">6666</span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="address"><span class="otherText">Address: </span><span id="addressText">1379 Philadelphia Avenue</span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="website"><span class="otherText">Website: </span><span id="websiteText">example.com</span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="extra1"><span class="otherText" id="extra1Label"></span><span id="extra1Text"> </span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="extra2"><span class="otherText" id="extra2Label"></span><span id="extra2Text"> </span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="extra3"><span class="otherText" id="extra3Label"></span><span id="extra3Text"> </span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="extra4"><span class="otherText" id="extra4Label"></span><span id="extra4Text"> </span></div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div id="extra5"><span class="otherText" id="extra5Label"></span><span id="extra5Text"> </span></div> 
 
      </td> 
 
      </tr> 
 
     </table> 
 
     </center> 
 
     &nbsp; 
 
     <p></p> 
 
     <table id = "editTable" cellpadding="0" cellspacing="0" border="0" style="background: none; border-width: 0px; border: 0px; margin: 0; padding: 0;"> 
 
      <tr> 
 
      <td> 
 
       <div id = "signatureEditorText">Signature Editor</div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div class = "editorTextInfo">Name</div> 
 
      </td> 
 
      <td> 
 
       <div class = "editorTextInfo">Job</div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <input id = "editorTextInfoName" type = "text" class = "editorTextBox"> 
 
      </td> 
 
      <td> 
 
       <input id = "editorTextInfoJob" type = "text" class = "editorTextBox"> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <div class = "editorTextInfo">Company</div> 
 
      </td> 
 
      <td> 
 
       <div class = "editorTextInfo">At/At the</div> 
 
      </td> 
 
      </tr> 
 
      <tr> 
 
      <td> 
 
       <input id = "editorTextInfoCompany" type = "text" class = "editorTextBox"> 
 
      </td> 
 
      <td> 
 
       <input name = "radio" id = "editorRadioInfoCompany1" type = "radio" class = "editorRadio"> &nbsp;&nbsp;&nbsp; 
 
       <input name = "radio" id = "editorRadioInfoCompany2" type = "radio" class = "editorRadio"> 
 
      </td> 
 
      </tr> 
 
     </table> 
 
    </body> 
 
</html>

2

スニペット問題。

input[type = "radio"] { margin:5px } 
関連する問題