WordPress.org

Ready to get started?Download WordPress

Forums

Date and time one seperate lines - why? (5 posts)

  1. sjlim
    Member
    Posted 8 years ago #

    Hello. I am pretty new to php and css.

    My homepage is at http://www.stevelim.com

    From the main page, I call the loop. For some reason (that is probably very trivial), the date and time are not on the same line. Its probably some simple php or css thing which is causing the line to break.

    my code for the problem line is <?php the_date('','<h3>','</h3>'); ?><?php the_time() ?>

    Thanks.

  2. It's the <h3> tags. Remove those from the php_the_date() function. Put them around the pair of functions instead...

  3. sjlim
    Member
    Posted 8 years ago #

    Thanks LesBessant. Hmmm.. what if I wanted them to look different? Can I mix css with the 2 functions but still have them on the same line?

    Thanks.

  4. You could use <span class="whatever"> around each, rather than <h3>. You could then define your new classes in your CSS to do whatever you want...

  5. sjlim
    Member
    Posted 8 years ago #

    The primary difference between the <span> and <div> tags is that <span> doesn't do any formatting of it's own. The <div> tag acts as a paragraph break, because it is defining a logical division in the document. The <span> tag simply tells the browser to apply the style and align rules to whatever is within the <span>.

    Thank you LesBessant!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.