Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7986051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:44:11+00:00 2026-06-04T11:44:11+00:00

I am currently using UIWebview for some rich text formatting. I would like to

  • 0

I am currently using UIWebview for some rich text formatting. I would like to center on the same line a succession of an icon (PNG image) followed by a caption. I am having issue to set up correctly my css style to get the expected effect. It is more a css related question than on Objective C.

So far what I have done is:

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];

The result i am getting is a succession of icon and caption but not on the same line. Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:44:12+00:00Added an answer on June 4, 2026 at 11:44 am

    the margin:0px auto allows to center a containing block on a page. Here the width I set was fixed. Since it was fixed the content will try to fit within the fixed width and is displayed in multiple lines. What i need to use instead is to use the text-align for the container div.

    Here is the code i finally use:

     NSString* htmlContentString = [NSString stringWithFormat:
                                       @"<html>"
                                       "<style type=\"text/css\">"
                                       "h1 { font-size: 40px;\
                                             font-family: Wisdom Script;\
                                             text-align: center;\
                                             margin-top:15px;\
                                             margin-bottom:0px;\
                                             background-color: transparent;\
                                       }"
                                       "body { background-color:transparent;\
                                               font-family:Helvetica;\
                                               font-size:14;\
                                               margin-top:0px;\
                                        }"
                                       " img {\
                                              width:40px;\
                                              height:35px;\
                                              vertical-align:bottom;\
                                       }"
    
    
                                       "#text {\
                                            width:60px\
                                       }"
                                       "#container {\
                                                text-align:center;\
                                       }"
                                       ".insetText {\
                                       color: #020202;\
                                       text-shadow: 0 -1px 0 rgba(0,0,0,0.15),\
                                       0 1px 0 rgba(255,255,255,0.8)}"
                                       "@font-face { font-family: 'Wisdom Script'; \
                                       src: local('WisdomScriptAI'),\
                                       url('wisdom_script.ttf') format('truetype'); }"
                                       "</style>" //end the style section
    
                                       "<body>" //start content
                                            "<h1 class=\"insetText\">%@</h1>"
                                            "<div id=\"container\" class=\"insetText\">\
                                                <img src=\"tipnbpeople_icon.png\"/>Caption1\
                                                <img src=\"clock_icon.png\"/>Caption2\
                                                <img src=\"chef_icon.png\"/>Captions3</div>"
                                       "</body></html>"\
                                       , noAccentTipName];
    

    This displays 3 icons with the corresponding caption on the same line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im currently using a plugin called Cycle for jQuery and would like to tweak
I am using some code to save a png file from UIWebView. It isn't
I have some HTML content in my app using UIWebView. I'd like to have
I'm currently using below method to call an external php file with some variables
Im currently using a UITableView like any other, and I am researching into the
so currently using ajax with JQuery .post to return a form populate with some
Im currently using base64_encode for some $_GET params that i don't want regular user
Currently using a MySQL database Wanting to insert a new row into a table
Currently using Chrome v19.0.1084.46 (Official Build 135956) beta-m jqGrid 4.3.2 (latest release) The problem
Currently using the HTTPServletRequest class and specifically the .getQueryString method to retrieve an inputted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.