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:Hiroyuki Tamura
  • 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:Hiroyuki Tamura
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>
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.


Author Comment

by:Hiroyuki Tamura
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:Hiroyuki Tamura
ID: 24414839
thank you.
do you know how to align the image vertically center?

Author Closing Comment

by:Hiroyuki Tamura
ID: 31581988
thank you.

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now