简体   繁体   中英

Aligning inside li element text and picture PHP

Hello,

I have a problem with aligning text and picture inside li element. The li consist of one word and one picture (for example English [picture]). I need that picture would go to the right side and text would stay as it is (now it is goes to the left side). The code looks like:

    for($i=0; $i < $rowCount; $i++){        
?>
<li><a href="?lang=<?php echo $l[$i]?>"><?php echo $i?><img src="/flags/flag_of_lithuania.gif" width="20" height="10"> </a></li>
<?php
}

Now it prints language and picture, however everything aligned to the left side. Looking for any help :)

Try this

    for($i=0; $i < $rowCount; $i++){        
?>
<li><a href="?lang=<?php echo $l[$i]?>"><?php echo $i?><img style="float:right" src="/flags/flag_of_lithuania.gif" width="20" height="10"> </a></li>
<?php
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM