HighDots Forums  

xhtml

alt.html.tags alt.html.tags


Discuss xhtml in the alt.html.tags forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mark Strain
 
Posts: n/a

Default xhtml - 01-25-2005 , 01:36 PM






can any one tell me how to align an image to the centre of the page using
xhtml. i've tryed

<p><img src="my pic" align="middle"/></p>

the pic still is displayed on the left and not in the centre -
im told you cant use the centre tag in xhtml



Reply With Quote
  #2  
Old   
Merlin Fradley
 
Posts: n/a

Default Re: xhtml - 01-26-2005 , 12:17 AM







"Mark Strain" <markscomp (AT) tesco (DOT) net> wrote

Quote:
can any one tell me how to align an image to the centre of the page using
xhtml. i've tryed

p><img src="my pic" align="middle"/></p

the pic still is displayed on the left and not in the centre -
im told you cant use the centre tag in xhtml


I don't know how valid it is for xhtml, but I was trying to do this and only
managed it by enclosing the img tag within a p tag, and using

text-align:center;

on the p with a stylesheet.

HTH

ps. I would be interested in finding a better way.

--


Merlin




Reply With Quote
  #3  
Old   
Mark Strain
 
Posts: n/a

Default Re: xhtml - 01-26-2005 , 06:18 AM




im told there is a way using css - so gone away to try to learn it

"Merlin Fradley" <merlin.fradley (AT) btinternet (DOT) com> wrote

Quote:
"Mark Strain" <markscomp (AT) tesco (DOT) net> wrote in message
news:lkwJd.231$iD3.156 (AT) newsfe5-win (DOT) ntli.net...
can any one tell me how to align an image to the centre of the page using
xhtml. i've tryed

p><img src="my pic" align="middle"/></p

the pic still is displayed on the left and not in the centre -
im told you cant use the centre tag in xhtml



I don't know how valid it is for xhtml, but I was trying to do this and
only
managed it by enclosing the img tag within a p tag, and using

text-align:center;

on the p with a stylesheet.

HTH

ps. I would be interested in finding a better way.

--


Merlin





Reply With Quote
  #4  
Old   
Merlin Fradley
 
Posts: n/a

Default Re: xhtml - 01-26-2005 , 12:41 PM




"Mark Strain" <markscomp (AT) tesco (DOT) net> wrote

Quote:
im told there is a way using css - so gone away to try to learn it

That's what I did. The html looked thus:

<p class="aligncenter"><img src="...." alt="...."></p>

And the css looked like this:

..aligncenter {text-align:center;}

The combination centered the image at the top of the page.

--


Merlin




Reply With Quote
  #5  
Old   
gus
 
Posts: n/a

Default Re: xhtml - 03-20-2005 , 06:04 PM




"Merlin Fradley" <merlin.fradley (AT) btinternet (DOT) com> wrote

Quote:
"Mark Strain" <markscomp (AT) tesco (DOT) net> wrote in message
news:k0LJd.255$hv1.176 (AT) newsfe1-win (DOT) ntli.net...

im told there is a way using css - so gone away to try to learn it

That's what I did. The html looked thus:

p class="aligncenter"><img src="...." alt="...."></p

And the css looked like this:

.aligncenter {text-align:center;}

The combination centered the image at the top of the page.

--


Merlin


you should just be able to put <p align="middle"><img src="whatever"></p>
and the paragraph will align anything within it to the center. i don't know
though, i don't know xhtml.




Reply With Quote
  #6  
Old   
Jim Michaels
 
Posts: n/a

Default Re: xhtml - 02-03-2006 , 03:17 AM



I just learned this:
float:center;
float:left;
float:right;
float:inherit;

<img style="float:center;" width=...>

"Merlin Fradley" <merlin.fradley (AT) btinternet (DOT) com> wrote

Quote:
"Mark Strain" <markscomp (AT) tesco (DOT) net> wrote in message
news:lkwJd.231$iD3.156 (AT) newsfe5-win (DOT) ntli.net...
can any one tell me how to align an image to the centre of the page using
xhtml. i've tryed

p><img src="my pic" align="middle"/></p

the pic still is displayed on the left and not in the centre -
im told you cant use the centre tag in xhtml



I don't know how valid it is for xhtml, but I was trying to do this and
only
managed it by enclosing the img tag within a p tag, and using

text-align:center;

on the p with a stylesheet.

HTH

ps. I would be interested in finding a better way.

--


Merlin





Reply With Quote
  #7  
Old   
Jim Michaels
 
Posts: n/a

Default Re: xhtml - 02-03-2006 , 03:21 AM




"Jim Michaels" <jmichae3 (AT) yahoo (DOT) com> wrote

Quote:
I just learned this:
float:center;
float:left;
float:right;
float:inherit;

img style="float:center;" width=...

there I go shooting off my mouth too soon again. center is not an option.
the others are. Use a P tag. <p align=center></p>
but be warned that the align attribute is deprecated. I really wish w3c
would leave us with something to replace these with.


Quote:
"Merlin Fradley" <merlin.fradley (AT) btinternet (DOT) com> wrote in message
news:ct795s$r01$1 (AT) sparta (DOT) btinternet.com...

"Mark Strain" <markscomp (AT) tesco (DOT) net> wrote in message
news:lkwJd.231$iD3.156 (AT) newsfe5-win (DOT) ntli.net...
can any one tell me how to align an image to the centre of the page
using
xhtml. i've tryed

p><img src="my pic" align="middle"/></p

the pic still is displayed on the left and not in the centre -
im told you cant use the centre tag in xhtml



I don't know how valid it is for xhtml, but I was trying to do this and
only
managed it by enclosing the img tag within a p tag, and using

text-align:center;

on the p with a stylesheet.

HTH

ps. I would be interested in finding a better way.

--


Merlin







Reply With Quote
  #8  
Old   
David Dorward
 
Posts: n/a

Default Re: xhtml - 02-03-2006 , 05:15 AM



Jim Michaels wrote:

Quote:
there I go shooting off my mouth too soon again. center is not an option.
the others are. Use a P tag. <p align=center></p
but be warned that the align attribute is deprecated. I really wish w3c
would leave us with something to replace these with.
They did, as described elsewhere in this THIRTEEN MONTH DEAD thread you
decided to revive.

http://groups.google.co.uk/group/alt...b?dmode=source

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Reply With Quote
  #9  
Old   
Gazza
 
Posts: n/a

Default Re: xhtml - 02-03-2006 , 12:19 PM





Jim Michaels mumbled the following on 03/02/2006 08:17:
Quote:
I just learned this:
float:center;
float:left;
float:right;
float:inherit;
Cobblers.
<http://www.w3.org/TR/REC-CSS1#float> only allows left, right and none.

--
Gazza
Mobile Number Network Checker - http://mnnc.net/
Leovanna Leonbergers - http://leovanna.co.uk/
Scarlet Town - http://scarlettown.co.uk/


Reply With Quote
  #10  
Old   
Gazza
 
Posts: n/a

Default Re: xhtml - 02-03-2006 , 12:21 PM





David Dorward mumbled the following on 03/02/2006 10:15:
Quote:
Jim Michaels wrote:


there I go shooting off my mouth too soon again. center is not an option.
the others are. Use a P tag. <p align=center></p
but be warned that the align attribute is deprecated. I really wish w3c
would leave us with something to replace these with.


They did, as described elsewhere in this THIRTEEN MONTH DEAD thread you
decided to revive.

http://groups.google.co.uk/group/alt...b?dmode=source
I just thought Thunderbird was playing up and filtering all the original
messages for some reason...

--
Gazza
Mobile Number Network Checker - http://mnnc.net/
Leovanna Leonbergers - http://leovanna.co.uk/
Scarlet Town - http://scarlettown.co.uk/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.