Howto vertical-align a webview?
Hi,
I tried out several kinds of html code (with complete html, head, body tags - without html tags and just div style tag, ….) but I can't get a webview to vertical-align:middle the contained text….
webview.html =
<html><head><style>body { background-color: transparent;
vertical-align:middle;}</style></head>
<body>My content...this is text...</body>
</html>
webview.html =
<div style="vertical-align:middle;">My content...this is text...</div>
can somebody give me an example how to vertically-align the content of a webview without using a local html file?
I put my html code into my webview with the webview.html setting.
Thanks for any help
3 Answers
-
Try :
<div style="position:relative;top:50%">My content...this is text...</div>
-
Hi kosso, thanks for the answer, but that doesn't seem to work like vertical-align.
I also have bulletpoint-lists with 5 to 10 entries which should be automatically aligned in the vertical middle of the webview…do you have any other idea? -
Ha! I got it!
This works:<table style=\"height:100%;\"> <tr> <td style=\"vertical-align:middle;\">"+mytext+"</td> </tr> </table>
Doesn't work with body, div or p tags.
Pheew….. :)