NSString *HTML = [NSString stringWithFormat:@"<html> \n"
"<head> \n"
"<meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0; maximum-scale=1.0;\">"
"<div id='main' style type=\"text/css\"> \n"
"body {font-family: \"%@\"; font-size: %@; color:rgb(30,30,30); line-height: %ipx;}\n"
"</div> \n"
"</head> \n"
"<body>%@</body> \n"
"</html>", @"helvetica", [NSNumber numberWithInt:[UIFont mainTextFont].pointSize], kWebViewLineSpacing, text];
I’m trying to apply a div id main to my content, but I can’t figure out how to get it to work. I think the line in question is : “<div id='main' style type=\"text/css\"> \n" but I’m not sure how I would adjust it to work?
You’re putting a div in the head section, that’ll not work