Submit text to UIWebView on iPhone OS using inline CSS?

Using CSS in UIWebView, how can I make the right text from left to right? What CSS am I looking for?

Example

<p style='text-align: justify;'>

does not work. What happens instead justify

?

+2


a source to share


1 answer


just inserted from an old project. I hope this helps



    NSString *css = [NSString stringWithFormat:
                     @"<html><head><style>body { background-color: transparent; text-align: %@; font-size: %ipx; color: white;} a { color: #172983; } </style></head><body>", 
                     @"justify",
                     16];

    NSMutableString *desc = [NSMutableString stringWithFormat:@"%@%@<br><br>%@<br><br>%@%@", 
                             css,
                             sampleText,
                             sampleText,
                             sampleText,
                             @"</body></html>"];

    UIWebView *webView = (UIWebView *)[self viewWithTag:WEB_VIEW_TAG];
    [webView loadHTMLString:desc baseURL:nil];

      

+11


a source







All Articles