Hack Forums
Centering plain images - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Webmasters (https://hackforums.net/forumdisplay.php?fid=141)
+---- Forum: Website Construction (https://hackforums.net/forumdisplay.php?fid=50)
+---- Thread: Centering plain images (/showthread.php?tid=5200699)



Centering plain images - Profatssor - Mar 12, 2016

My question is not about centering an image on a webpage, I'm well aware of how to do that in html/css. What I'm wondering is for an image that is hosted on my site, for example this one, is there a way to center that?

Firefox automatically does this, but in chrome, the image just gets pushed up to the top-left corner.

I have apache on my server and I was wondering if there is a way to make it use a template or something to display all images on a default page.

Edit: I was thinking I could use apache rewrite rules to redirect any requested image to another page, but how would I make that page contain the specified image?

If you can help me out, leave a post or PM me. Cheers 🤝


* - Nakamoto. - Mar 12, 2016

(Mar 12, 2016 06:02 AM)Profatssor Wrote:  My question is not about centering an image on a webpage, I'm well aware of how to do that in html/css. What I'm wondering is for an image that is hosted on my site, for example this one, is there a way to center that?

Firefox automatically does this, but in chrome, the image just gets pushed up to the top-left corner.

I have apache on my server and I was wondering if there is a way to make it use a template or something to display all images on a default page.

Edit: I was thinking I could use apache rewrite rules to redirect any requested image to another page, but how would I make that page contain the specified image?

If you can help me out, leave a post or PM me. Cheers 🤝

I don't quite understand what it is you are asking for help with, are you trying to center just one image or multiple or? I think I am reading the post wrong or something.


* - PloxSource - Mar 12, 2016

(Mar 12, 2016 07:40 AM)RenRioku™ Wrote:  I don't quite understand what it is you are asking for help with, are you trying to center just one image or multiple or? I think I am reading the post wrong or something.

I read it wrong first too.

Basically, if you open the image in the browser (Chrome), you'll see that the image is in the top left corner. But if you open the image in Firefox, it is centered.

OP: I believe its just what the browser does.


* - Nakamoto. - Mar 12, 2016

(Mar 12, 2016 01:42 PM)PloxSource Wrote:  I read it wrong first too.

Basically, if you open the image in the browser (Chrome), you'll see that the image is in the top left corner. But if you open the image in Firefox, it is centered.

OP: I believe its just what the browser does.

That is browser dependent, when you view an image you are view an image file not a webpage.


* - Profatssor - Mar 12, 2016

(Mar 12, 2016 07:04 PM)ng-chris Wrote:  No there is no way to do this.

Concise and straight answer. Thank you.