0
我在webview中显示了一些内容,该内容以<p>
开头并以</p>
标记结尾。我正在通过loadDataWithBaseURL将内容加载到webview中,并尝试在中间显示内容:如何将中心的内容与Webview对齐
public static String contentPrefix = "<html><head><style type='text/css'>#content_wrapper {position: relative; margin: 0px auto;} </style></head><div id='content_wrapper'>";
public static String contentPostfix = "</div></html>";
webView.loadDataWithBaseURL("", contentPrefix + result + contentPostfix, "text/html", "UTF-8", "");
但它不起作用。我应该怎么做才能在中间显示内容?