how to change background colour in echo

后端 未结 3 2054
旧时难觅i
旧时难觅i 2021-01-28 11:44

i am trying to apply the background color in echo using an inline style but it is not applying background color in however changes only the text color. i want to change backgrou

相关标签:
3条回答
  • 2021-01-28 12:01

    Try like

    echo "<p style='color:orange;background-color:red;'>record number: ".$rec_num. "</p><br>";
    

    You have to end ' single quote after the background-color style.

    0 讨论(0)
  • 2021-01-28 12:20

    Or you can ajust only the print lines with styles

    print "<p style='color: red;border: 1px solid black;height:20px;box-shadow: 1px 1px 7px;'>"."message!: ".$db_field['TEXTAREA1'] . "<br>";
    

    after this i got an fancy box around the text =) i love boxes in many ways

    so no echo where placed only print {} function

    Many thanx and good luck

    ps ['textarea1'] <-- is assigned to database so it reads only that table

    0 讨论(0)
  • 2021-01-28 12:27

    try

    echo "<div style='background-color:red;'><p style='color:orange'>"."record number:     ".$rec_num. "</p></div>"."<br>";
    
    0 讨论(0)
提交回复
热议问题