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

  • Home
  • SEARCH
  • 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 7081085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:52:35+00:00 2026-05-28T06:52:35+00:00

If I have a character (say +) inside text and I would like to

  • 0

If I have a character (say “+”) inside text and I would like to place it in a bordered box, I can just wrap it in a span and set border: solid 1px of course. But what if I wish to have specific dimensions for the box, like 0.5em by 0.5em? By default, span is inline, so width and height are ignored.

I thought setting display: inline-box would help, but this seems to cause the borders to be drawn in odd ways, so that the character is not in the box at all, and differently in different browsers; see http://jsfiddle.net/csMLu/

Is there something I need to set on the element, or is there a better basic approach?

  • 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-05-28T06:52:35+00:00Added an answer on May 28, 2026 at 6:52 am

    Setting line height and text-align seems to make it work, however the 0.5em container is to small for the text.

    .box05 {
        height: .5em;
        width: .5em;
        line-height: .5em;
        font-size: .9em  /* smaller then the others */
    }
    
    .box06 {
        height: .6em;
        width: .6em;
        line-height: .6em;
    }
    
    .box07 {
        height: .7em;
        width: .7em;
        line-height: .7em;
    }
    
    .box08 {
        height: .8em;
        width: .8em;
        line-height: .8em;
    }
    
    .box09 {
        height: .9em;
        width: .9em;
        line-height: .9em;
    }
    
    
    p { margin: 1em; }
    span { border: solid #444 1px; text-align: center; display: inline-block; }
    <p>Use the <span class="box05">+</span> button!
    
    <p>Use the <span class="box06">+</span> button!
        
    <p>Use the <span class="box07">+</span> button!
        
    <p>Use the <span class="box08">+</span> button!
        
    <p>Use the <span class="box09">+</span> button!
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a LazySeq of java.lang.Character like (\b \ \! \/ \b
Let's say I have the following three strings: (section1){stuff could be any character, i
I have a single hexadecimal character, say char c = 'A'; What's the proper
I need to get the last character of a string. Say I have testers
I have a data frame containing (in random places) a character value (say foo
I have a simple string which is delimited by some character, let's say a
Let's say for example that I have a regular expression like this: The quick
I have a character that's say, 20 by 10 pixels large and I have
Say 1 character is 1Byte, so i have 10 characters, and that is 10Bytes.
lets say I have an html document how can I remove every thing from

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.