开发者

How would you style a PHP suffix with CSS?

I've setup a date object in PHP: $date_formatting = "l, M jS";

Note the uppercase S to the right of开发者_StackOverflow社区 the day (j). This creates a suffix such as 3rd, 1st, 2nd.

The problem is I don't know how to go about targeting only the suffix for CSS styling. I would like to make the suffix a smaller font size than the number.

Any clues?


$date_formatting="l, M j<\s\u\p>S<\/\s\u\p>";

What this does is puts the <sup> tag around the S. This tag is for superscript.


Or, if you want to avoid the pain of escaping all of that...

echo date("l, M j")."<span class='whatever'>".date("s")."</span>";


$date_formatting = "l, M, j<\s\m\a\l\l>S</\s\m\a\l\l>";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜