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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:33:38+00:00 2026-05-17T01:33:38+00:00

I have a div wrapped around a couple span ‘s and using JS to

  • 0

I have a div wrapped around a couple span‘s and using JS to make the span’s fade in and out (for testimonials). Everything works, except I can’t get the span text to center within the div. Here’s the relevant code:

HTML –

<div class="slideshow">
    <span style="font-size:12px; color:#333333; font-family:Lucida Grande,Lucida Sans Unicode,Calibri,Arial,sans-serif;">Hi</span>
    <span style="font-size:12px; color:#333333; font-family:Lucida Grande,Lucida Sans Unicode,Calibri,Arial,sans-serif;">Goodbye</span>
</div><br />

And here’s the slideshow CSS –

.slideshow {
width:940px;
height:64px;
background-image:url(../images/quotes.png);
}

Can anyone tell me what I’m doing wrong? Oh and yes I’ve tried text-align:center; with no luck.

[Edit] I’d like to add I’ve also tried adding in !important with no change.

  • 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-17T01:33:39+00:00Added an answer on May 17, 2026 at 1:33 am

    You need to apply text-align: center to the containing <div>, and not do anything that causes the <span>s to be rendered as a block (such as floating them). Absolute positioning would also pull elements out of normal flow so they wouldn’t be influenced by text-align.


    Update : Now a working example has been provided, we can see what is going on. The span elements are being absolutely positioned by the plugin:

    $slides.css({position: 'absolute', top:0, left:0}).hide()
    

    Looks like you will need to rethink the layout logic the plugin is using.

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

Sidebar

Related Questions

I have an image that is wrapped inside a couple of DIV elements <div
i have div's wrapped under div's my html code is. <div id=content-row> <div id=left-box>
Let's say I have a page using the Validation Plugin more or less as
I have an unlimited/unbound number of DIV tags that are floating to the left.
I have a <div> that has contentEditable=true . When I copy-paste content within the
I am still learning jQuery and have come up against something I just can't
I have a line of text that I'm wanting to position a small graphic
Here is my markup, it's generated from a CMS and I can't do much
Let me start by saying that I'm not a power-JavaScript/jQuery programmer, I do very

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.