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 7717293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:51:12+00:00 2026-06-01T02:51:12+00:00

I am trying to do some CSS to complement my HTML code. I am

  • 0

I am trying to do some CSS to complement my HTML code. I am effectively trying to make a little box which changes size based on the amount of text there is. Currently, this is what it looks like in action.
enter image description here

Essentially, I’d like it to form a little box around the text. Notice the last ‘box’ in the image, if the string is too long, it cuts it off and continues on the next line.

Included is the CSS code and an example of usage.

<style type="text/css">
  boxytest
  {
    padding: 10px;
    text-align: center;
    line-height: 400%%;
    background-color: #fff;
    border: 5px solid #666;
    -webkit-border-radius: 30px;
    -moz-border-radius: 30px;
    border-radius: 30px;
    -webkit-box-shadow: 2px 2px 4px #888;
    -moz-box-shadow: 2px 2px 4px #888;
    box-shadow: 2px 2px 4px #888;
  }
</style>

<body>
  <div align="center">
   <boxytest> Hey guys! What's up? </boxytest>
  </div>
</body>

Any help is greatly appreciated.

  • 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-01T02:51:13+00:00Added an answer on June 1, 2026 at 2:51 am

    Well, I think first off, in terms of markup, you want to make boxytest a class, and not create a new element. And don’t use ‘align=center’. It’s a pain to maintain.

    I would do something like this:

    <body>
      <p class="boxy">Test sentence</p>
    <body>
    

    The in CSS:

     .boxy {
      padding: 10px;
      text-align: center;
      line-height: 400%%;
      background-color: #fff;
      border: 5px solid #666;
      -webkit-border-radius: 30px;
      -moz-border-radius: 30px;
      border-radius: 30px;
      -webkit-box-shadow: 2px 2px 4px #888;
      -moz-box-shadow: 2px 2px 4px #888;
      box-shadow: 2px 2px 4px #888;
      /* to prevent word wrapping */
      white-space: nowrap;
      overflow: hidden;
      }
    

    The last bit is based on this post.

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

Sidebar

Related Questions

trying to learn some html/css and I'm having a problem with fixed position divs.
I'm trying to learn some html/css/javascript, so I'm writing myself a teaching project. The
I'm trying to practice some CSS/HTML, and I am listing what should be done
I'm trying to apply some CSS to the last .topic-wrapper div (which is inside
I'm trying to use html and css to present some simple vector notation in
I am trying to create some HTML/CSS for footer navigation. What I would like
I'm trying to inject some CSS that accompanies some other HTML into a C#
I am trying to write some css rules which should only affect the TextFields
I'm trying to parse some css files using a code project parser found here
I have this HTML file with some CSS styles, now I am trying to

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.