CodeIgniter Forums
img helper, img tag and position of an image - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: img helper, img tag and position of an image (/showthread.php?tid=55631)



img helper, img tag and position of an image - El Forum - 11-04-2012

[eluser]GabrieleMartino[/eluser]
Hi,

the img helper and the relative image tag do not support attribute like align="center". Also the div align="center" has been deprecated.

How should some one set an image on a side of the screen without use the px esplicit expression?

I put here this discussion to know if there is another solution that use some helper for other tags.




img helper, img tag and position of an image - El Forum - 11-04-2012

[eluser]Ewout[/eluser]
You describe the problem, but could you please explain further what you are trying to accomplish?


img helper, img tag and position of an image - El Forum - 11-05-2012

[eluser]noslen1[/eluser]
This is CSS dude, not CI, nor even HTML.
Set "text-align : center;" on the parent div.


img helper, img tag and position of an image - El Forum - 11-05-2012

[eluser]GabrieleMartino[/eluser]
The answer is in the html and css, the question can be also set in codeigniter as the image helper do not provide the position of an image.

Just set a tag

Code:
<center> &lt;?php echo img(...) ?&gt; </center>

dude.


img helper, img tag and position of an image - El Forum - 11-05-2012

[eluser]noslen1[/eluser]
The <center> tag is not supported in HTML5, and is deprecated in HTML 4.01. But yes it should work.
I maintain you should use some CSS.