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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:15:59+00:00 2026-06-05T13:15:59+00:00

I am trying to make a virtual die (for playing dice) using CSS/HTML and

  • 0

I am trying to make a virtual die (for playing dice) using CSS/HTML and JavaScript… My JavaScript part is working, but I can’t seem to get the HTML/CSS to display it the way I want (without creating a borderless table and putting each dot in a cell). I made the following JSfiddle: http://jsfiddle.net/ShoeMaker/KwBaN/5/ and when you get a 4, 5, or 6 you can see my problem..

I want to get an analog die with a set of square brackets [ ] with the correct number of dots inside.
1. should have one dot in the middle-middle
2. should have one dot in the top-left and one in the bottom-right
3. should have one dot in the top-left, one in the middle-middle, and one in the bottom-right
4. should have one in the top-left, top-right, bottom-left, and bottom-right
5. should have one in the top-left, top-right, middle-middle, bottom-left, and bottom-right
6. should have three across the top and three across the bottom (or three down the left side and three down the right side).

I’ve thought about creating a border-less table, but I would like to try and do it with block/inline and super/sub first.
I do NOT want to display images (not allowed).
They only need to display the end result, not flicker and pretend to be rolling (although that may be cool in the future).
I don’t care to make them “digital” using ASCII characters or the like. (Too traditional, like analog dice).

Any ideas my my fiddle isn’t working as I intend?

Couple of minor additional notes…

  • I may want to use this with “non-standard” dice ( those with 7, 9, 12, 20, ??? sides ) in the future, needs to be easily adaptable (Using “:” doesn’t work).

  • Would like it to be relatively small (Shouldn’t take up 1/8 of the screen per die (Yahtzee would take more than half the screen!))

  • 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-05T13:16:02+00:00Added an answer on June 5, 2026 at 1:16 pm

    A couple of things.

    Span elements are already inline elements so you don’t need to specify such within your css.

    Note, that your “row” elements are now wrapped within a parent container with a display style of “inline-block”. The inner elements were changed to be block elements as you want them to be “stacked” on top of each other to achieve your desired effect.

    <span class="bracket">[</span>
    <div id="die">
        <div id="TopRow">&nbsp;&nbsp;&nbsp;</div>
        <div id="MidRow">&nbsp;&nbsp;&nbsp;</div>
        <div id="BotRow">&nbsp;&nbsp;&nbsp;</div>
    </div>
    <span class="bracket">]</span>
    
    #die {
        display: inline-block; 
        padding: 5px;             
    }
    
    span.bracket {
        font-size: 95px;       
    }
    
    #TopRow, #MidRow, #BotRow {
        font-weight: bold;           
    }
    

    ​
    Updated fiddle: http://jsfiddle.net/KwBaN/11/

    EDIT:
    As per your comment here is another update to make the “die” a little smaller:

    div {
         padding: 0;
         margin: 0; 
    }
    
    #die {
        display: inline-block;              
    }
    
    span.bracket {
        font-size: 40px;       
    }
    
    #TopRow, #MidRow, #BotRow {
        font-weight: bold;  
        font-size: 12px;
        line-height: 8px;    
    }
    

    another updated fiddle: http://jsfiddle.net/KwBaN/34/
    ​

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

Sidebar

Related Questions

I am using a JavaScript virtual keyboard for an ASP.NET TextBox. But using a
Trying to make a sphere. But it so doesn't look like 3D, in fact
Trying to make a simple client that consumes a web service using RemObjects SDK,
Trying to make a floating css menu. How do I get the floating div
I'm sorta a noob at these things but I'm trying to make a simple
I am trying to make an chat application using python and django. I almost
I'm trying to use setup the rails application on apache2 using the virtual server
I'm trying to make a virtual shelf type of thing which is populated via
I'm trying to make the root directory for a virtual host so that it
Im trying to make a ssl client that connects to ssl IRC Servers but

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.