title: How to display html content on UIWebView IOS
body: <p>I have a form sheet segue that should display hard-coded html page.
  Now I have a two part problem first problem is </p>
  
  <pre><code> &lt;CENTER&gt;&lt;H1&gt;A Simple Sample Web Page&lt;/H1&gt;&lt;H4&gt;By Frodo&lt;/H4&gt;
  &lt;H2&gt;Demonstrating a few HTML features&lt;/H2&gt;&lt;/CENTER&gt;
  </code></pre>
  
  <p>is displayed like</p>
  
  <p><img src="https://i.stack.imgur.com/Ktw4b.png" alt="enter image description here"></p>
  
  <p>I can change <code>&lt;CENTER&gt;</code>tag to <code>&lt;left&gt;</code> in that case it works but it limits my options. How can I display this content In the middle of the screen without alignment issues? </p>
  
  <p>Second part of the question is How can I embed a color or a link to content. On line  <code>""FFFFFF"&gt;\n"</code> I get the error that says <code>Expected ':'</code> and on line <code>"&lt;a href="http://somegreatsite.com"&gt;\n"</code> Half of the line is green which is seems like comment on the screen that means it will not executed by XCode</p>
  
  <p>My full code is like :</p>
  
  <pre><code>- (void) createWebViewWithHTML{
      //create the string
      NSMutableString *html = [NSMutableString stringWithString: @"&lt;html&gt;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;&lt;body style=\"background:transparent;\"&gt;"];
  
      //continue building the string
      [html appendString:@"&lt;BODY BGCOLOR="
       ""FFFFFF"&gt;\n"
       "&lt;CENTER&gt;&lt;IMG SRC="clouds.jpg" ALIGN="BOTTOM"&gt;
       "&lt;/CENTER&gt; \n"
       "&lt;HR&gt;\n"
       "&lt;a href="http://somegreatsite.com"&gt;\n"
       "Link Name&lt;/a&gt;\n"
  
       "is a link to another nifty site\n"
  
       "&lt;H1&gt;This is a Header&lt;/H1&gt;\n"
  
       "&lt;H2&gt;This is a Medium Header&lt;/H2&gt;\n"
  
       "Send me mail at &lt;a href="mailto:support@yourcompany.com"&gt;\n"
  
       "support@yourcompany.com&lt;/a&gt;.\n"
  
       "&lt;P&gt; This is a new paragraph!\n"
  
       "&lt;P&gt; &lt;B&gt;This is a new paragraph!&lt;/B&gt;\n"
  
       "&lt;BR&gt; &lt;B&gt;&lt;I&gt;This is a new sentence without a paragraph break, in bold italics.&lt;/I&gt;&lt;/B&gt;\n"
  
       "&lt;HR&gt;\n"];
      [html appendString:@"&lt;/body&gt;&lt;/html&gt;"];
  
      //instantiate the web view
      webView = [[UIWebView alloc] initWithFrame:self.view.frame];
  
  
      //make the background transparent
      [webView setBackgroundColor:[UIColor clearColor]];
  
      //pass the string to the webview
      [webView loadHTMLString:[html description] baseURL:nil];
  
      //add it to the subview
      [self.view addSubview:webView];
  
  } 
  </code></pre>
  
  <p>Edit::
  Added story board picture</p>
  
  <p><img src="https://i.stack.imgur.com/Ra5g5.png" alt="enter image description here"></p>
  
  <p><strong>So how can I make correct alignment and embed color/link correctly?</strong></p>