Nasıl bu metne bir resim eklerim?

3 Cevap php
<?php
    if (mysqli_num_rows($new_result) == 1)
        {
            if ($row['borrowingPower'] == 'mayor')
                print "<div id='verified'>This User is Verified!<div>";
        }
?>

Metne ek olarak "Bu Kullanıcı Onaylı olduğunu", nasıl ben sadece sağ ya da sadece metin üzerinde bir görüntü ekran yapabilir?

BU İŞ İÇİN İLAVE TEST DOSYA http://neighborrow.com/wanted_test.php?item=116

3 Cevap

Bir <img> etiketiyle:

<?php
    if (mysqli_num_rows($new_result) == 1)
        {
            if ($row['borrowingPower'] == 'mayor')
                print "<div id='verified'>This User is Verified! <img src='icon_ok.png' style='vertical-align: middle' alt='' /><div>";
        }
?>

Bir img element (alt metin üzerinde bölüm bu makalede biraz eksik olduğunu unutmayın, bu yüzden de bakın this document).

Bunu yapmanın başka bir yolu DIV elemanı için bir css sınıfı ekliyor

CSS kodu:

.user_verified {
    background: url(../images/user_verified.png) no-repeat 0 0;
    padding-left:20px;
}

PHP kodu:

<?php
    if (mysqli_num_rows($new_result) == 1)
        {
            if ($row['borrowingPower'] == 'mayor')
                print "<div id='verified' class='user_verified'>This User is Verified!<div>";
        }
?>