问题为html电子邮件对齐div

时间:2016-01-19 10:25:31

标签: html css

我一直在审查一些关于如何将两个div并排排列的旧帖子,但是我似乎无法做到这一点。我有一封HTML电子邮件,我想通过两个按钮发送,然后接受'并且'拒绝'我正在测试的代码I在下面。



Template.stdSingleView.helpers({
    studenthistory: function(){
        var id= FlowRouter.getParam('id');
        return posts.findOne({_id: id});
    }
});




我已经提供了我得到的结果,你可以看到他们没有正确排队,任何帮助都会非常感激。

4 个答案:

答案 0 :(得分:2)

你忘记了"在div id属性rejectButton之后。

答案 1 :(得分:1)

你忘了#rejectButton

的双引号



<!DOCTYPE html> <html> <head> <style> #buttonGroup {
  width: 100%;
  margin: 0 auto;
}

#acceptButton {
  width: 50%;
  float: left;
}
#rejectButton {
  width: 50%;
  float: left;
}
</style> </head> <body> <div id=buttonGroup> <div id="acceptButton"> <p align="center"><!--[if mso]> <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{!$Label.Site_URL_Prefix}campaignAccept?leadid={!CampaignMember.LeadId}{!Lead.Id}&contactid={!CampaignMember.ContactId}{!Contact.Id}&campaignId={!Campaign.Id}&action=Accept" style="height:40px;v-text-anchor:middle;width:200px;" arcsize="13%" strokecolor="#31b934" fillcolor="#2c772e"> <w:anchorlock/> <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">Accept</center> </v:roundrect> <![endif]--><a href="{!$Label.Site_URL_Prefix}campaignAccept?leadid={!CampaignMember.LeadId}{!Lead.Id}&contactid={!CampaignMember.ContactId}{!Contact.Id}&campaignId={!Campaign.Id}&action=Accept" style="background-color:#31b934;border:1px solid #2c772e;border-radius:5px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;mso-hide:all;">Accept</a></p> </div> <div id="rejectButton">
<p align="center"><!--[if mso]> <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{!$Label.Site_URL_Prefix}campaign?leadid={!CampaignMember.LeadId}{!Lead.Id}&contactid={!CampaignMember.ContactId}{!Contact.Id}&campaignId={!Campaign.Id}&action=Reject" style="height:40px;v-text-anchor:middle;width:200px;" arcsize="13%" strokecolor="#d12835" fillcolor="#921620"> <w:anchorlock/> <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">Decline</center> </v:roundrect> <![endif]--><a href="{!$Label.Site_URL_Prefix}campaign?leadid={!CampaignMember.LeadId}{!Lead.Id}&contactid={!CampaignMember.ContactId}{!Contact.Id}&campaignId={!Campaign.Id}&action=Reject" style="background-color:#d12835;border:1px solid #921620;border-radius:5px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;mso-hide:all;">Decline</a></p> </div> </div> </body> </html>
&#13;
&#13;
&#13;

答案 2 :(得分:0)

注意到,“接受”按钮位于div内,在该div中,它具有<p>标记。

由于哪些路线出错,

<p>有余量。

也可以添加<p>标记以拒绝或从#acceptButton p { margin: 0; } 标记中删除边距。

喜欢

HTML

工作Fiddle

希望这有助于。

- 帮助:)

答案 3 :(得分:0)

你必须更多地关注编写id的

时问题是错误的代码

<!DOCTYPE html> <html> <head> <style> #buttonGroup {
  width: 100%;
  margin: 0 auto;
}
#acceptButton {
  width: 50%;
  float: left;
}
#rejectButton {
  width: 50%;
  float: left;
}
</style> </head> <body> <div id="buttonGroup"> <div id="acceptButton"> <p align="center"><!--[if mso]> <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{!$Label.Site_URL_Prefix}campaignAccept?leadid={!CampaignMember.LeadId}{!Lead.Id}&contactid={!CampaignMember.ContactId}{!Contact.Id}&campaignId={!Campaign.Id}&action=Accept" style="height:40px;v-text-anchor:middle;width:200px;" arcsize="13%" strokecolor="#31b934" fillcolor="#2c772e"> <w:anchorlock/> <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">Accept</center> </v:roundrect> <![endif]--><a href="{!$Label.Site_URL_Prefix}campaignAccept?leadid={!CampaignMember.LeadId}{!Lead.Id}&contactid={!CampaignMember.ContactId}{!Contact.Id}&campaignId={!Campaign.Id}&action=Accept" style="background-color:#31b934;border:1px solid #2c772e;border-radius:5px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;mso-hide:all;">Accept</a></p> </div> <div id="rejectButton">
<p align="center"><!--[if mso]> <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{!$Label.Site_URL_Prefix}campaign?leadid={!CampaignMember.LeadId}{!Lead.Id}&contactid={!CampaignMember.ContactId}{!Contact.Id}&campaignId={!Campaign.Id}&action=Reject" style="height:40px;v-text-anchor:middle;width:200px;" arcsize="13%" strokecolor="#d12835" fillcolor="#921620"> <w:anchorlock/> <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">Decline</center> </v:roundrect> <![endif]--><a href="{!$Label.Site_URL_Prefix}campaign?leadid={!CampaignMember.LeadId}{!Lead.Id}&contactid={!CampaignMember.ContactId}{!Contact.Id}&campaignId={!Campaign.Id}&action=Reject" style="background-color:#d12835;border:1px solid #921620;border-radius:5px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;mso-hide:all;">Decline</a></p> </div> </div> </body> </html>

相关问题