Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.1k views
in Technique[技术] by (71.8m points)

Is there a way to style an email tag that becomes a premade HTML <a> link?

I'm working on creating an email notification within helpdesk software, Sysaid. The software uses HTML markup for its email notifications in combination with email tags starting with $ to act as stand-ins for information submitted within the software. The below tags

$Approve
$Deny
$LinkToSubTab

should all turn into links. and while they do- the first two become pre-wrapped hyperlinks that come with the <a href="example URL">example text</a> and the last one is just a normal link. Ideally I want to make them all act as buttons, but putting the pre-wrapped $tag breaks the html of all the ways of implementing buttons or styling I've tried. I've found that I can change stuff like the font- size of said hyperlinks by adding the <font size=50> tag before the link, but haven't had success yet with attaching stylings or text decorations to said links. To be clear, this isn't about the Sysaid software itself but rather finding a way to style a hyperlink that comes premade from an email tag, from outside of the tag. the tag $Approve becomes an <a href='link'>Text<a> that's premade, and attempting to fit it into a button or text decoration (in my limited understanding) breaks the element.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

While I've never worked with the software you're describing, if you want to style an HTML hyperlink you could try using CSS to apply styles based on a wrapper element:

/*This will directly effect the a tag*/
.hyperlink-wrapper a {
  color: green;
}
<div class="hyperlink-wrapper">
  <a href="#">Link</a>
</div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...