How can I add a conditional !doctype html html head !--if IE style type="text/css" span.mktFormMsg margin-top:0px /style !endif-- /head into a form? | Community
Skip to main content
May 6, 2014
Solved

How can I add a conditional !doctype html html head !--if IE style type="text/css" span.mktFormMsg margin-top:0px /style !endif-- /head into a form?

  • May 6, 2014
  • 3 replies
  • 1345 views
I have to create a conditional for span.mktFormMsg in ie. I added the code below ito the editing box but it was ignored:

<!doctype html>
<html>
<head>
<!--[if IE]>
<style type="text/css">
      span.mktFormMsg {
       margin-top:0px;
}
</style>
<![endif]-->
</head>

Rest of the code
</html>

Can you please indicate where can I place it?

Thank you.


Regarding your response:
1. We will be dropping the form into several landing pages
2. I added the code into the HTML editor in the form
3. I did not use the emulation tool. I am testing directly into ie.

Can you please indicate where can I place the conditional?

Thank you.
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Matt_Stone2
Are you dropping the form onto a Marketo landing page or embedding it? If the former, you can try placing the conditional CSS in the landing page layout.

As a side note: if you're testing this with Internet Explorer's developer tools, more recent versions did not recognize conditional comments with the emulation tool -- though it looks like they even-more-recently fixed it: http://connect.microsoft.com/IE/feedback/details/806767/conditional-comments-do-not-work-when-emulating-document-modes-via-f12-developer-tools

3 replies

Matt_Stone2
Matt_Stone2Accepted solution
Level 9
May 6, 2014
Are you dropping the form onto a Marketo landing page or embedding it? If the former, you can try placing the conditional CSS in the landing page layout.

As a side note: if you're testing this with Internet Explorer's developer tools, more recent versions did not recognize conditional comments with the emulation tool -- though it looks like they even-more-recently fixed it: http://connect.microsoft.com/IE/feedback/details/806767/conditional-comments-do-not-work-when-emulating-document-modes-via-f12-developer-tools
May 6, 2014
Regarding your response:
1. We will be dropping the form into several landing pages
2. I added the code into the HTML editor in the form
3. I did not use the emulation tool. I am testing directly into ie.

Can you please indicate where can I place the conditional?

Thank you.
Matt_Stone2
Level 9
May 7, 2014
Try dropping it into the landing page template's HTML.

Go into the Design Studio > Landing Pages > Find the template(s) of the pages that will have the form on them > Click "Edit Draft"

You'll see the full code for the landing page template and you can scroll down till you find the </head> tag and put your conditional styling right above it.

Make sure to approve the template and the updated draft of your landing page and see if that works.