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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:27:51+00:00 2026-05-25T21:27:51+00:00

I am trying to create a little graphical box for a time element on

  • 0

I am trying to create a little graphical box for a time element on a website. What I would like to have is something like this:

final

I have this HTML:

<div class="entry-meta">
    <time class="entry-date" datetime="2011-09-16T09:59:48+00:00" pubdate="">
        <span class="date-day">16</span>
        <span class="date-month">Sep</span>
        <span class="date-year">2011</span>
    </time>
</div>

And this CSS so far:

.entry-meta {
    display: block;
    color: white;
    float: left;
    background: #aaa;
}

.date-day {
    display: block;
    font-size: 30px;
    background: #444;
    float: left;
}

.date-month {
    display: block;
    font-size: 12px;
    background: #666;
    float: left;
}

.date-year {
    display: block;
    font-size: 12px;
    background: #888;  
    float:left; 
}

My problem is that I cannot achieve two things:

  1. To align the text to the corners of the box and forget about the baseline. I would like to align 16 to the top left corner and cut it’s box at the bottom right corner. I am looking for eliminating all the spacing pixels.
  2. To move the year under the month, without specifying exact width and height properties. If I delete float: left then it goes under the day. What I would like to have is to move it right of the day and under the month. Do I need to create an other div or spand for the month + year?
  3. Also, it seems that it doesn’t matter if I remove display: block from the span CSS-es why is it?

Here is a jsFiddle I created:
http://jsfiddle.net/ESbqY/3/

ver3

An update one based on Kolink’s suggestion:
http://jsfiddle.net/ESbqY/5/

ver5

  • 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-25T21:27:52+00:00Added an answer on May 25, 2026 at 9:27 pm

    Fully customizable:

    http://jsfiddle.net/5MMc9/8/

    html:

    <div class="entry-meta">
        <time class="entry-date" datetime="2011-09-16T09:59:48+00:00" pubdate="">
            <div class="date-day">16</div>
            <div class="container">
            <div class="date-month">Sep</div>
            <div class="date-year">2011</div>
            </div>
        </time>
    </div>
    

    css:

    .entry-meta {position: relative; font-family: Trebuchet MS;}
    .container {float: left;}
    .date-day {font-size: 70px; line-height: 55px; float: left; background: #fa7d7d;}
    .date-month {font-size: 25px; line-height: 25px; background: #627cc6; padding: 0 0 5px 0;}
    .date-year {font-size: 25px; line-height: 25px; background: #3ce320;}
    

    Furthermore, you can add display: inline-block; to the month css if you want the div to be same width as text inside.

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

Sidebar

Related Questions

I am trying to create a little growl like div for a site. It
I'm trying to create a little Ruby hack to make something like the reverse
i'm just trying to create this little simulator. in a gui, i have two
I'm trying to create a little enum and I'm just stuck: Why doesn't this
I have a little issue with my coding. I am trying to create 2
I was trying to create a quick little script that would insert data into
I am trying to create a little 3d raised panel or box on my
I’m trying to create a little static html start page with ssh links to
I was originally trying to follow this algorithm to create a little simple roguelike
What I currently have I'm currently trying to create a little download manager in

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.