Android - Strange Behavior html style max-width

dp24

New Member
I want to show some html in a WebView. In that html code there is an image tag "img src" and a style within: style="max-width:300px;max-height:300px;".My Smartphone's display width is 480px. When I set the max-width style to 480px, the image don't fit to the display and is not complete visible. Arround the WebView, there is no Margin or Padding. But when i set the max-width to 300px, the image fit perfect.What is the reason of that ? My display has a width of 480px und the image with that style 300px.\[code\]webView.loadData(newContent, "text/html", "UTF-8");\[/code\]Html Code (newContent):\[code\]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title></title></head><body bgcolor="white" leftmargin="0" topmargin="0"><img src="http://stackoverflow.com/questions/14430912/http:...jpg" style="max-width:300px;max-height:300px;" /><p>Text Text Text</p></body></html>\[/code\]
 
Back
Top