473,379 Members | 1,302 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,379 software developers and data experts.

Can't get <img> to align center?

Oddly, I can't seem to get the image to align to the center of the page?
I'm using IE 6, tried FireFox 2 still the same! The image just aligns to the right
for same reason. The text aligns to the center fine, see my code below:

[HTML]<body>
<h1 align=center>Test</h1><br><br>
<img src="italy.jpg" align=center height=160 width=240 border=4>
</body>[/HTML]
Oct 11 '07 #1
3 3708
drhowarddrfine
7,435 Expert 4TB
There is no such attribute for images as "align". And this makes sense because an image is an inline element, just as text is. <h1>, however, is block level and that's why align is available.

To center the image, you should use CSS.
<img style="margin:auto">
Oct 12 '07 #2
thanks for that, someone suggusted <center></center> which also did the trick.

Thanks again.
Oct 12 '07 #3
drhowarddrfine
7,435 Expert 4TB
<center> was deprecated many years ago. Use CSS.
Oct 12 '07 #4

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

Similar topics

15
by: Philipp Lenssen | last post by:
My friend has the following problem (background: we want to transform XML to XHTML via XSLT): "We copy XHTML fragments into an output by using the following template: <xsl:template match="*"...
5
by: MyndPhlyp | last post by:
I've been busting my head trying to figure this out for quite some time. With IE6 and NS7, no problems. I can simply code the HTML <img height="100%"> and be done with it. But NS4 and NS6 (and...
7
by: Zhang Weiwu | last post by:
Hello. This is problem puzzled me a long time. I wish to organize some block elements and let them flow one after each other like text. Think about a album, I wish the album have 12 thumbnails,...
2
by: btfbg | last post by:
I am using Response.ContentType = "application/msword" Response.AddHeader "Content-Disposition", "attachment;filename=Letter.doc" to download my asp page to the client. The download process...
8
by: KS | last post by:
Just to show some code to show the consept. <img id="date" onclick="javascript:show_calendar();" src="/PlexSysWeb/images/show-calendar.gif" width=20 height=18 border=0> What i want the...
15
by: Gérard Talbot | last post by:
Hello all, I'd like to know and understand the difference between, say, <img src="/ImageFilename.png" width="123" height="456" alt=""> and <img src="/ImageFilename.png" style="width:...
2
by: R.A.M. | last post by:
Hello, (sorry for my English...) Could you help me please with one asp.net problem? I am beginner... I am writting simple Demo .NET application. On start page I have: <h1>Demo .NET</h1> <br...
6
by: terry13 | last post by:
Hi there, This code is working fine in IE7 as submit button for the search form, but not in Firefox. Any ideas why. <img src="../../Images/Go.jpg" width="45" height="20" align="absmiddle"...
4
by: bgold12 | last post by:
Hey, I've come across a strange behaviour that shows itself in IE 7.0 and Firefox 3 and probably other browsers. In the code below, which is a complete HTML document which validates as XHTML 1.0...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.