I’m using following code to display an image with CodeIgniter framework.
<?php echo img('sample/logo.png'); ?>
And this is producing following output::
<img alt="" src="http://localhost:8080/test/css/sample/logo.png">
Why it does not closes the tag with />
Also, how can i specify the alt text when i echo image?
thanks
According to user guide, it should end with />. I tried it out, and it works.
If you want a shorter tag, use this:
Sometimes if you view source using certain browsers (firefox, chrome), it omits the /> tag. Try view source using a notepad or something, it should display proper /> tag.