HTML image center

Posted on 2009-05-15
Last Modified: 2012-06-21
how do i show an image always come center?
one html page has one image always come center.
and if i need to show text over image, how do i do it?
Question by:Tony T
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 19

Accepted Solution

erikTsomik earned 125 total points
ID: 24397192
there number of may to do this.

<center><img src=""></center>

<div align="center"><img src=""></div>

Author Comment

by:Tony T
ID: 24397201
thank you.
if i want to make any blank space between the corner of the window, what should i do?
LVL 19

Assisted Solution

erikTsomik earned 125 total points
ID: 24397270
just add CSS. add id to the div
<style type="text/css">


<div id="newLine" align="center"><img src=""></div>
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

by:Tony T
ID: 24397306
thank you.
if i have a link on the page, how do i make it?
should i do text over image and make link or use div to make a link over image?
i want to try text over image but i don't know how.
LVL 19

Assisted Solution

erikTsomik earned 125 total points
ID: 24397342
for example you have this
<div class="image">
  <img alt="" src="" />
  <div class="text">

Then you just add css to the <head> and it should work
.image {
      float:left; /* optional */
.image .text {
      top:10px; /* in conjunction with left property, decides the text position */
      width:300px; /* optional, though better have one */

Author Comment

by:Tony T
ID: 24414839
thank you.
do you know how to align the image vertically center?

Author Closing Comment

by:Tony T
ID: 31581988
thank you.

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mobile apps - web/native or hybrid? 1 117
links not working 2 31
Jquery HTML() with ajax... replacing content 2 48
Insert PHP into HTML page. 7 43
This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question