473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How do I center a image in CSS?

How do I center an image in CSS?

I tried adding: align:center but that did not work
it's an image wrapped by a div.

Expand|Select|Wrap|Line Numbers
  1. <div style="align:center">
  2. <img src=".."/>
  3. </div>
  4.  
Apr 5 '12 #1
2 2024
johny10151981
1,059 1GB
This is interesting. div css dont have any align. but you can use tag align.

follow the link. here is some suggestion
Apr 12 '12 #2
<div style="text-align:center"><img src=""></div>

or

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

or

<div><center><img src=""></center></div>
Apr 16 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: steven | last post by:
Hi, I'm trying to center an image in a div, both horizontally and vertically. (Each div holds a thumbnail image.) Here's the HTML: <div class="thumb"> <div> <img src="tn_02-2022.jpg" />...
6
by: Zach | last post by:
i have code using pixel to define how i want preview image to appear when someone does rollover on one of my menus (css menu code from eric meyer!) and i cannot figure out how to make the image...
11
by: mercurius_1 | last post by:
I need some help with this page: http://www.sarahpollock.com/new/x.php I stole much of this layout from "A List Apart," but I'm no CSS guru and I desperately need some help with the finishing...
3
by: Dustin Carroll | last post by:
Hello, I am trying to capture a right mouse button click on an image. So far I am getting the left click with <body onload="document.getElementById('image').onclick=eventclick;"> <image...
5
by: Maaike | last post by:
I'm trying to get my photo's centered. In my current layout it works, but I'm changing the design of my website. In the source it calls voor myinlinepicture In source: <div...
4
hsriat
by: hsriat | last post by:
How can i render an image in the center of a page. I did this: <table width="100%" heigth="100%"> <tr> <td valign="middle" align="center"><img...... /></td> </tr> </table>
24
by: GloStix | last post by:
I'm trying to center this banner, it's in a div that has the same width so it's not exactly "centering" but it's screwed up, It works in safari but in Firefox it's messed up. I uploaded a Video to...
2
by: jerrygadd | last post by:
Can some body help me vertically center an image using CSS? The customer only uses IE, and so the code is not debugged for other browsers! The image in question is found on line 1075 :...
14
by: gaijinco | last post by:
I was a hobbist web coder for years but I had to sidestep for a while. Now I'm trying to return to it and I'm trying to clarify how am I supposed to do somethings with CSS v.s. HTML and I'm...
0
by: Alex K | last post by:
Hi everyone, I'm working on something of a digital tapestry, where by clicking images along the way you can scroll through the length of the story. The tapestry is long and will only scroll...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.