- This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi,
i have this line of code for blog:
echo ‘
Posted on ‘.date(‘d M Y’, strtotime($row[‘postDate’])).’
‘;
How can i edit date in css. I have found the tutorial for css date icon, but i can’t figure it out where to use span class in this echo post. To have icon with d M Y?
Thanks for answers.
CSS styles HTML
What HTML does your PHP function output?
echo ' Posted on '.date('d M Y', strtotime($row['postDate'])).'
‘;this is the code,
i want to make icon out of date like link to icon.
HTML output is Posted on 31 august 2014
echo ' Posted on '.date('d M Y', strtotime($row['postDate'])).'
I’m guessing just outputs a date…it’s not outputting HTML elements.
Into what HTML element is the output placed?
oh i see, the paragraphs where missing in the question.
echo '<p>Posted on '.date('d M Y', strtotime($row['postDate'])).'</p>';
its like that, so it is in paragraphs.
So it outputs a <p>Posted on 31 august 2014</p>
?
Not much you can do with that if you are trying to turn it into a ‘calendar like’ icon.
At the very least it should be broken up into separate parts like…
<p class="post-date">
<span class="post-date-head">Posted on</span>
<span class="post-date-day">31</span>
<span class="post-date-month">August</span>
<span class="post-date-year">2014</span>
</p>
That way we have separate elements that can be styled individually.
Get your PHP to spit that out…and you have a shot.
Thanks i think i did it. Now i just need to style it with CSS.
echo '<span class="post-date-day">'.date('d', strtotime($row['postDate'])). '</span>';
echo '<span class="post-date-month">'.date('M', strtotime($row['postDate'])). '</span>';
echo '<span class="post-date-year">'.date('Y', strtotime($row['postDate'])). '</span>';
So now you have the elements in place…you can see what you can do.