I want to give style in my echo tag in php for example echo 'hello world';
if i want the text to be bold or color yellow so how do i give style to this? Ans me the right solution not the shortcut Thanks.
I want to give style in my echo tag in php for example echo 'hello world';
if i want the text to be bold or color yellow so how do i give style to this? Ans me the right solution not the shortcut Thanks.
You can try this:
<?php echo '<span class="heading">Hello World!</span>' ?>
<style>
.heading{color:red;}
</style>
echo '<span style="font-weight: bold; color: yellow;">hello world</span>';
etc.) the span only takes up as much horizontal space as its content. text-align: center IS working, but you're applying it to an element that doesn't have a width greater than its content (as all block elements do).
You can generate the HTML according to your requirements.
For e.g.
echo "<b>Hello World</b>"; // Bold text
echo "<i>Hello World</i>"; //Italics text
echo "<div style='text-color:blue;'>Hello World</div>" ; //Blue colored text
There are many other ways you can thave this. Try to generate the correct HTML and CSS.