Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Sbrocket

macrumors 65816
Original poster
Jun 3, 2007
1,250
0
/dev/null
This question is more one of proper CSS formatting than anything else, so hopefully there are some knowledgeable web-types around here too.

I've got a UIWebView that I'm setting up to replace a UIImageView+UITextView combination that I was using previously, since I need some better rich-text support that (*shakes fist*) UITextView doesn't support. :mad:

I'm trying to get my text to center vertically around the UIWebView. I've gotten this far with my generated html string, which works pretty well considering I know basically nil about CSS:

Code:
<html>
<head>
<style type="text/css">
body, html {font-weight: bold; font-family: helvetica; font-size: 22pt;}
div {line-height: 38px; position: absolute; top: 0px;}
</style>
</head>
<body background="file:///BigPathSnip/ProConvert.app/textViewBackground.tif">
<div>56</div>
</body>
</html>
(where 38 pixels is the height of that UIWebView there)

GoodImage.png


...except when you add in a superscript or subscript...

Code:
{snip}
<div>56<sup>2</sup></div>
{snip}


BadImage.png


And that's obviously not what I want. Any tips or solutions? It'd be much appreciated; rushing to get this finished before you-know-when. ;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.