Reputation: 7965
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
Upvotes: 0
Views: 450
Reputation: 1963
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.
Upvotes: 0
Reputation: 689
<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>
Upvotes: 1
Reputation: 3217
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>
Upvotes: 1