Adding a break within an anchor tag (Using CMS)

I have a website that runs on WordPress. There is a call to action (CTA) on the front page with contact details for the website business. Within the backend one is prompted to enter an email address and phone number for the call to action.

This is then output in an anchor tag:

Read More
<a class="front-button" href="mailto:myname@example.com">
                    Tel: 123.456.7891  myname@example.com               </a>

This creates a fairly large and intrusive big long button on the home page, where the email and phone number are displayed on one line.

Within the CMS I tried to add a break tag in the actual CTA button input box:

myname@example.com <br /> Tel: 123.456.7891

This just output the exact same html as above, the <br /> tag was ignored.

I could hard edit the html within the CMS but have two questions:

1) Is there a way to add the break within the CMS input box for the call to action? I imagined something like the opposite of an escape backslash character that says “No, this is html don’t ignore”

2) Does a <br /> tag even work when nested within an anchor <a> tag?

CMS input box

Related posts

Leave a Reply

1 comment

  1. Question 1 – can you get your CMS to accept the line break tag?

    Depending on the specific CMS – if it has a visual editor, shift and enter can usually get you a line break. If it allows the HTML source to be edited, that should work although the CMS may be using a crude regex that doesn’t understand self-closing tags, so try:

    <br>
    

    As well as the self-closing version.

    Question 2 – is a line break allowed in an anchor?

    In HTML5, a br element is allowed inside any “phrasing element” and an anchor is a phrasing element – so it is allowable to put a br tag inside an a tag.

    http://dev.w3.org/html5/markup/common-models.html#common.elem.phrasing