Darren Liu's Blog

Display an HTML Web Resource in a Form with No Border

with 4 comments

When you add an HTML Web Resource to an entity form a border will be displayed even when you do not check the Display Border checkbox of the formatting tab of the Web Resource Properties dialog box.

HtmlWebResource

To prevent a border from being displayed, set the style properties of the body element of the HTML document. You must also not include any DOCTYPE information. The following HTML will cause the HTML Web resource contents to display without a border.

 

<html>
<head>
<title>No Border Web Resource</title>
</head>
<body style="border-width: 0px; padding-left: 0px; padding-top: 0px; margin-left: 0px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px">
<p>
This Web Resource will display with no border</p>
</body>
</html>

By default, many HTML editors will include DOCTYPE information in the contents of the HTML. The following HTML with the same body style applied will still appear with a border.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Web Resource with Border</title>
</head>
<body style="border-width: 0px; padding-left: 0px; padding-top: 0px; margin-left: 0px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px;">
<p>
Style applied but border still appears.</p>
</body>
</html>

Thanks Jim Daly again for the information and I hope it helps you on your project.

Advertisements

Written by darrenliu

01/28/2011 at 1:14 am

Posted in CRM, Development

Tagged with ,

4 Responses

Subscribe to comments with RSS.

  1. Hey Darren

    Thanks so much for this post. Especially around the DocType information.

    I think it just saved me hours of pain!!

    Jason

    05/25/2011 at 4:17 pm

  2. […] some tinkering with internet explorer’s development tools  and reading Darren Liu’s blog I was able to remove the border. To remove the border you simply have to alter your web […]

    • It is no working
      it is still displaying with the border, please what’s the problem
      iVe tried with your code ans still is not working
      thanks for answering me

      TheeNerd

      01/02/2012 at 10:47 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: