您好,我需要在我的HTML NSString中设置CSS样式以适合UIWeView
中图像的大小。Img Css在NSString UIWebView中的百分比
这里是代码。
NSString *cssCode = @"img{max-width:100%}body{font-family:Custom-One;color:white;font-size:15px;text-shadow:1px 1px 2px black;-webkit-text-size-adjust: none;}";
NSString *myCustomString = [NSString stringWithFormat:@"<html><head><style>%@</style></head><body><b><font color=red><center> [ %@ ]</center></b><br/><b><center>[ Title ]</center> </font></b><br/>%@<body></html>",cssCode,[self.app stripTags:mmObject.title],myData];
[self.myWebView loadHTMLString:myCustomString baseURL:nil];
它不适用于max-width:100%
。我认为百分比符号是问题所在。 我该怎么做?