Jump to content

Leading spaces


niche

Recommended Posts

I think this is more of a php question.What do I need to change to display the leading spaces in $var1?Script:

<html><body><?php$var1 = "                  (1 div)";echo '<p> 14th & Pine Lake Rd'.$var1.'</p>';?></body></html>

Thanks

Link to comment
Share on other sites

You could use   for each space. Or instead of using spaces you could use <span> tags around "(1 div)" and style it with some padding on the left.The <span> is probably the better option. Adjust the padding to whatever you need.

<span style="padding-left: 150px">(1 div)</span>

Link to comment
Share on other sites

How would the <span> solution work?
<?php$var1 = "<span style='margin-left: 120px;'>(1 div)</span>";echo '<p> 14th & Pine Lake Rd'.$var1.'</p>';?>

You could also take this a step farther and create a class for that span if you're going to be repeating this pattern multiple times.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...