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];
我正在尝试将 div idmain
应用于我的内容,但我不知道如何让它工作。我认为有问题的行是:“<div id='main' style type=\"text/css\"> \n"
但我不确定如何调整它以使其工作?