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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:10:39+00:00 2026-05-23T06:10:39+00:00

So I know I butchered the title a bit but if someone looks here

  • 0

So I know I butchered the title a bit but if someone looks here http://grainandgram.com/theexchange/fivequestions-benrunkle/ at where it says ‘Five Question With a Craftsman’ you’ll understand better. Basically he has a div with a background and then a div wrapped inside. The Div inside is set to be in the middle of the line and has a white background. I’d like to do something similar but center it. My problem when I center it htough is my data is dynamic and I cannot set a width. With no width the div extends out to both sides.

Is there a way to center the text and not have a width and not have the div automatically expand to a 100% of the width?

Below is the HTML and CSS.

<div class="grid_24" id="section">
<div class="section_fivequestions">Five Questions With A Craftsman</div>
</div>

#section {
height: 2px;
background-color: #BCA474;
margin-bottom: 20px;
margin-top: 40px;
width:940px;
text-align:center;
}


.section_fivequestions {
font-weight: bold;
text-transform: uppercase;
font-size: 10px;
line-height: 3px;
background-color: white;
color: #BCA474;
width: 225px;
margin: auto;
}

Note if the width: portion is removed the div’s width becomes 940px. If I keep the width but enter text longer than 225px the alignment is off and no longer centered.

Any ideas on how to allow the text inside to be of any length and not have the div span the entire width?

  • 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-23T06:10:40+00:00Added an answer on May 23, 2026 at 6:10 am

    a display:inline on the inner div?

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

Sidebar

Related Questions

I know that this sort of question has been asked here before, but still
I know this is a bit of an odd request but it is all
You know this link: http://media.photobucket.com/image/graphics/PennilessTeacher/Graphics/monster.jpg?o=8 redirects to this link: http://i1133.photobucket.com/albums/m581/PennilessTeacher/Graphics/monster.jpg Well, let's say I
The title really says it all, a bit more info though for those who
Know this might be rather basic, but I been trying to figure out how
I know you can not set a key value dynamically, but what about the
I know that Phonegap has an event for back button, but it's only available
i know this is a stupid question but i d'ont know how to do
I know it's usually the other way around, but I have some extenuating requirements
I know i have bothered all of you with my questions but i have

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.