• 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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • It’s the <h3> tags. Remove those from the php_the_date() function. Put them around the pair of functions instead…

    Thread Starter sjlim

    (@sjlim)

    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.

    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…

    Thread Starter sjlim

    (@sjlim)

    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!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Date and time one seperate lines – why?’ is closed to new replies.