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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:09:59+00:00 2026-06-18T10:09:59+00:00

Been struggling with a problem now. I have a list that behaves quite weird,

  • 0

Been struggling with a problem now.

I have a list that behaves quite weird, and couldt find the problem until i firebugd it and saw that the entire file prints out in one row.

something like this.

<div class="clock-content-wrapper"><ul class="clock-digit-wrapper hour"><li class="clock-digit-one"></li><li class="clock-digit-three"></li></ul><ul class="clock-digit-wrapper minute"><li class="clock-digit-three"></li><li class="clock-digit-seven"></li></ul><ul class="clock-digit-wrapper second"><li class="clock-digit-zero"></li><li class="clock-digit-zero"></li></ul></div>

There is no spaces between the elements.

Now i didn’t know that could be a problem so i started to fix the elements in firebug like this.

<div class="clock-content-wrapper">
<ul class="clock-digit-wrapper hour">
<li class="clock-digit-one"></li>
<li class="clock-digit-three"></li>
</ul>
<ul class="clock-digit-wrapper minute">
<li class="clock-digit-three"></li>
<li class="clock-digit-seven"></li>
</ul>
<ul class="clock-digit-wrapper second">
<li class="clock-digit-zero"></li>
<li class="clock-digit-zero"></li>
</ul>
</div>

And notice that if i have the </ul> element under my </li> the script actually works at it supposed to.

Is there a way to structure the file with javascript ?
I have a jsFiddle, where you can se the differens between the tree created in HTML and the one with JavaScript.
http://jsfiddle.net/Xk49c/

I really dont want to change anything in the css . since both html and js application is using the same css .

  • 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-18T10:10:00+00:00Added an answer on June 18, 2026 at 10:10 am

    The problem is, when you create the elements using HTML, you indent or separate the elements with one or more spaces, or even new lines. HTML renders these spaces as ONE single space and so you see the space between those elements.

    To add spaces between elements created by JavaScript, either you ll have to add a padding left to minute and second class, or insert a text node between each UL

    hours = createElementWithClass('ul', 'clock-digit-wrapper hour');
    clock_toolbar_wrapper_close.appendChild(hours);
    clock_toolbar_wrapper_close.appendChild(document.createTextNode(' ')); // Add this
    
    
    minutes = createElementWithClass('ul', 'clock-digit-wrapper minute');
    clock_toolbar_wrapper_close.appendChild(minutes);
    clock_toolbar_wrapper_close.appendChild(document.createTextNode(' ')); // And this
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been struggling with a problem that I have for days now and I
I have been struggling with this problem for quite a long time now. I
I have a problem I have been struggling with for quite a while now
I've been struggling with Zend_Navigation all weekend, and now I have another problem, which
I have been struggling to find a solution to this problem. In my code,
I have been struggling with a problem for a couple of days now with
I have a problem that I have been struggling with for a few days
I have a very annoying problem that I've been struggling with for a few
I have been struggling to find a good detailed explanation for that anywhere. So
I have been struggling with this problem for several weeks now and would really

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.