tags:

views:

31

answers:

4

Hello there! here is the problem...I have just this line of code:

<p><div class="author"><?php echo $relevantEntry['author']." | ".date("D d M Y h:i:s A", strtotime($relevantEntry['date_time'])); ?></div></p>

and I want to apply a different css css to author and date...but I still want them to be in the same line and be presented as the same statement...

any ideas how can I do that? thanks

+1  A: 

Wrap the date in a:

<span class="dateclass"></span>

Like this

<p>
<div class="author">

<?php echo $relevantEntry['author']; ?>

<span class="date">
<?php echo date("D d M Y h:i:s A", strtotime($relevantEntry['date_time']));?>
</span>

</div>
</p>
DRL
A: 
<p><div class="author"><?php echo $relevantEntry['author']; ?> | <span class='date'> <?php echo date("D d M Y h:i:s A", strtotime($relevantEntry['date_time'])); ?></span></div></p>
GOsha
A: 

Use <span></span> to surround the portions of the line you want formatted a specific way.

<p>
    <div class="author">
        <span class="classOne"><?php echo $relevantEntry['author']."</span> | 
        <span class=\"classTwo\"".date("D d M Y h:i:s A", strtotime($relevantEntry['date_time'])); ?></span>
    </div>
</p>

The advantage of the <span> tag is that there is no inherent formatting involved that you will need to work around.

Joseph
A: 

If i'm not mistaken: Pls do this

".$relevantEntry['author'].""." | "."".date("D d M Y h:i:s A", strtotime($relevantEntry['date_time'])) .""; ?>

Sudhir