Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-28-2011, 07:42 AM   PM User | #1
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
Date properties

Hello

The date appears on my page using the following:

Code:
span.show_date { 
    font-size: x-small;
}
span.show_date sup {
    font-size: xx-small;
}
In order to right-align the date, would I use: text-align: right; and if I wanted to change the font-family color, size, etc of the date would I just group everything under span.show_date, as in

Code:
span.show_date { 
    text-align: right; 
}

and

span.show_date {
 font-family:"Times New Roman",Georgia,Serif;
 }
Thanks
SteveH is offline   Reply With Quote
Old 10-28-2011, 02:24 PM   PM User | #2
resdog
Regular Coder

 
Join Date: Aug 2011
Location: U.S.A.
Posts: 233
Thanks: 2
Thanked 48 Times in 48 Posts
resdog is on a distinguished road
<span> is an inline element, so you can't just make it right aligned. You would need a block level container in order to align text, like a <p> or a <div> tag.

In theory, what you're saying is correct (for changing the font), but your css shows a <sup> tag inside the show_date span, so in regards to specificity, the font-size: xx-small will be applied to the text inside the <sup> tag.

In order to give you a more precise answer, we would need to see the actual HTML code to see how the entities are laid out.
__________________
WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.
resdog is offline   Reply With Quote
Old 10-28-2011, 03:19 PM   PM User | #3
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
Hello resdog

Thanks for your reply.

This is all I have at the moment in my main (index.asp page):

Code:
<%@ Language="VBScript" %>



<%
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 "<span class=""show_date"">" & WeekdayName(Weekday(Date())) _
             & " " & Day(Date()) & "<sup>" & suffix & "</sup> " _
             & MonthName(Month(Date())) & "</span>"
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
"http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
<title>mySite</title>

<LINK REL=StyleSheet HREF="index.css" TYPE="text/css" MEDIA=screen>
</head>

<body>

</body>
</html>
Further advise would be appreciated.
SteveH is offline   Reply With Quote
Old 10-28-2011, 04:05 PM   PM User | #4
resdog
Regular Coder

 
Join Date: Aug 2011
Location: U.S.A.
Posts: 233
Thanks: 2
Thanked 48 Times in 48 Posts
resdog is on a distinguished road
Change the <span> element to a <p> element:
Code:
Response.Write "<p class=""show_date"">" & WeekdayName(Weekday(Date())) _
             & " " & Day(Date()) & "<sup>" & suffix & "</sup> " _
             & MonthName(Month(Date())) & "</p>"
and then you can right align the text using p.showdate
__________________
WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.
resdog is offline   Reply With Quote
Users who have thanked resdog for this post:
SteveH (10-28-2011)
Old 10-28-2011, 04:46 PM   PM User | #5
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
That's great resdog - just tried it and it works.

Many thanks

Steve
SteveH is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:22 AM.


Advertisement
Log in to turn off these ads.