現在、リッチ テキストの書式設定に UIWebview を使用しています。同じ行の中央に一連のアイコン (PNG 画像) とそれに続くキャプションを配置したいと思います。期待される効果を得るために css スタイルを正しく設定するのに問題があります。これは、Objective C よりも CSS 関連の質問です。
これまでのところ、私がやったことは次のとおりです。
NSString* htmlContentString = [NSString stringWithFormat:
@"<html>"
"<style type=\"text/css\">"
"h1 { font-size: 40px;\
font-family: Wisdom Script;\
text-align: center;\
margin-top:5px;\
margin-bottom:0px;\
background-color: black;\
}"
"body { background-color:transparent;\
font-family:Helvetica;\
font-size:14;\
margin-top:0px;\
}"
"#people { background: yellow\
url('tipnbpeople_icon.png')\
no-repeat left center;\
padding-left: 45 px;\
line-height: 40px;\
}"
"#container {\
width: 300px; \
margin:0px auto;\
border:1px dashed #333;\
}"
"</style>"
"<body>"
"<h1>%@</h1>"
"<div id=\"container\">\
<div id=\"people\">Caption1</div>\
<div id=\"people\">Caption2</div>\
<div id=\"people\">Caption3</div>\
</div>"
"</body></html>"\
, noAccentTipName];
私が得ている結果は、アイコンとキャプションの連続ですが、同じ行にはありません。何か案が?