center image horizontally??

D

David Stiles

Hi All,

I'm trying to add an image to a website. The web-site builder I'm using has
this tag:

<img style="width: 800px; height: 298px;"
alt="helo"
src="../jet_ranger.jpg"><br>


I tried the "align=center" tag but no joy. So, how can I center the image
on the page horizontally?

Any pointers really appreciated.
 
S

saz

Hi All,

I'm trying to add an image to a website. The web-site builder I'm using has
this tag:

<img style="width: 800px; height: 298px;"
alt="helo"
src="../jet_ranger.jpg"><br>


I tried the "align=center" tag but no joy. So, how can I center the image
on the page horizontally?

Any pointers really appreciated.
Any web-site builder that writes that kind of code belongs in the
garbage.

The simplest way, removing the crappy css code:

<div align="center">
<img alt="helo" src="../jet_ranger.jpg" width="800px" height="298px">
</div>

But there are several other ways using CSS *properly* to achieve the
same effect.

I would also recommend making the image no wider than 750px. At 800px,
you will get a horizontal scrollbar in 800 x 600.
 
D

David Stiles

saz said:
Any web-site builder that writes that kind of code belongs in the
garbage.

The simplest way, removing the crappy css code:

<div align="center">
<img alt="helo" src="../jet_ranger.jpg" width="800px" height="298px">
</div>

But there are several other ways using CSS *properly* to achieve the
same effect.

I would also recommend making the image no wider than 750px. At 800px,
you will get a horizontal scrollbar in 800 x 600.



Wow - you folks are great. Thanks very much!
 
D

David Dorward

saz said:
Any web-site builder that writes that kind of code belongs in the
garbage.
....

<div align="center">
Deprecated.

<img alt="helo" src="../jet_ranger.jpg"
width="800px" height="298px">

Wrong, the width and height attributes take integers or percentiles, they do
not take integers followed by the characters "px".
 
S

saz

Deprecated.

I know, but I did say it was the easiest.
Wrong, the width and height attributes take integers or percentiles, they do
not take integers followed by the characters "px".

I left "px" in solely for the example I was trying to make - the width
was too large. The browsers will ignore it anyway.
 
D

David Dorward

I left "px" in solely for the example I was trying to make

So you only wrote non-conformant HTML because you were teaching someone how
to write better HTML?!
The browsers will ignore it anyway.

Have you tested it in *every* user agent?
 
S

saz

So you only wrote non-conformant HTML because you were teaching someone how
to write better HTML?!


Have you tested it in *every* user agent?
Is there a reason why you are trying to pick a fight? If so, I grew up
a long time ago and won't bite.
 
D

David Dorward

saz said:
Is there a reason why you are trying to pick a fight?

My objectives were to:

(a) Warn people about the errors in your teaching

and

(b) Encourage you to not repeat them in future
 
D

dorayme

From: saz said:
(e-mail address removed) says...
But true. That really was crappy code.

Please confirm that when you become king, you will have the
writer, rather than or in addition to his markup, put in a
garbage can. This is very important because freedom is at stake.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top