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", "");
但它不起作用。我應該怎麼做才能在中間顯示內容?