0

hello guys,

how can i display the data from php mysql with text decoration for example underline or a dotted line css/html?

thanks.

4
Contributors
4
Replies
6
Views
4 Years
Discussion Span
Last Post by earlxph8
0

Exactly as you've mentioned. Output the data into a tag (possibly with a suitable classname), e.g.

echo "<blockquote>{$data['quote']}</blockquote>";

or

echo "<span class='special'>{$data['special']}</span>";

THen if you've got CSS rules:

.special{
    text-decoration: none;
    border-bottom: 1px blue dotted;
}
blockquote{
    border: 1px single black;
}
2

Dear earlxph8, if you know how to use html this will be very easy for you.

In html file you directly write
<p>Sample test</p>

however in PHP, you have to echo the html:
<?php echo "<p>Sample test</p>";?>

When you echo a string, it will be treated as a html text, so all html tags will work when echoed.
What is even more important is that you can edit the style of the tags exactly like you do in html, taking the same example:

HTML:

<p style="text-decoration:underline;">Sample Test</p>

In PHP:

<?php echo "<p style=\"text-decoration:underline;\">Sample Test</p>";?> *//the \ is to tell PHP that the string is not finished yet, so it will not end it.*

OR

<?php echo '<p style="text-decoration:underline;">Sample Test</p>';?> /*//no need for the \*/

With MYSQL, you can store an HTML block with it's style as it is in the database. When you echo the data using php, it will be treated as HTML.

Good Luck, For any other information feel free to ask :)

Edited by cmps

0

I Agree with These guys , but my favouraite way to combine html + PHP is like that

<div><?php echo "This is new paragraph generated by PHP ?> </div>

This really Makes it easier for complex multiplication

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.