Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    Date, spacing, margin

    Hello

    I don't wish to be pedantic, but what is the reason, please, for this space (screenshot attached) between the ordinal date and the name of the month?

    This is my code:

    Code:
    <%
    Dim suffix
    Select Case Day(Date())
        Case 1,21,31: suffix = "st"
        Case 2,22: suffix = "nd"
        Case 3,23: suffix = "rd"
        Case Else: suffix = "th"
    End Select
    
    Response.Write "<p class=""show_date"">" & WeekdayName(Weekday(Date())) _
                 & " " & Day(Date()) & "<sup>" & suffix & "</sup>" _
                 & MonthName(Month(Date())) & "</p>"
    
    
    %>
    and this is the CSS:
    Code:
    p.show_date { 
        font-size: 10px;  
    text-align: right; 
    margin-right:10px;
    
    }
    p.show_date sup {
        font-size: 10px;
    margin-right:10px;
    }
    I only noticed it after I had added the right-margin to pull the date away from the side a bit.

    Many thanks!
    Attached Thumbnails Attached Thumbnails Date, spacing, margin-space.jpg  

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,561
    Thanks
    80
    Thanked 4,495 Times in 4,459 Posts
    You put it there:
    Code:
    p.show_date sup {
        font-size: 10px;
        margin-right:10px;
    }
    Without that 10px margin on the right side of the <sup>...</sup> you wouldn't have any space. Just remove that or change it to the number of pixels you want.

    Nothing to do with ASP. Just CSS.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    SteveH (03-28-2013)

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    Thanks for that Old Pedant. It looks a bit better now at 5px.

    Cheers!

    Steve


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •