echo "<h1 class='price'>" . $currency . round( $price['daily'] ) . "</h1>";
Is there a way to print empty space before currency?
Edit: The above code gives me From₹3880 in my theme. But I want From $3880 with a space
PS: Noob here
Use the non-breaking space (
) HTML entity:
echo "<h1 class='price'> " . $currency . round( $price['daily'] ) . "</h1>";
Adding a space inside the quotes should do the trick.
echo "<h1 class='price'> " . $currency . round( $price['daily'] ) . "</h1>";
h1 is a block-level element. Unless you've modified its style, it will have some margin and padding from the browser by default. So, adding a space here doesn't make sense. Fix it in CSS, don't abuse HTML for layout.
echo "<h1 class='price'> {$currency} ". round( $price['daily'] ) . "</h1>";
or better still use
echo "<h1 class='price'> " . $currency . round( $price['daily'] ) . "</h1>";
Go through the following link