![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Are there any alignment commands for images? |
#3
| |||
| |||
|
|
what is the most elegent way to center an image inside a web page. |
#4
| |||
| |||
|
|
The display:inline is needed so that the image gets treated like text, which can then be centered with text-align:center. |
#5
| |||
| |||
|
|
Plus 'text-align:center' would need to be specified on a container element, not on the image itself. |
#6
| |||
| |||
|
|
The display:inline is needed so that the image gets treated like text, which can then be centered with text-align:center. Images are inline by default. |
#7
| |||
| |||
|
|
Mark Parnell <webmaster (AT) clarkecomputers (DOT) com.au> wrote: The display:inline is needed so that the image gets treated like text, which can then be centered with text-align:center. Images are inline by default. |
|
Plus 'text-align:center' would need to be specified on a container element, not on the image itself. |
#8
| |||
| |||
|
|
In article <4bcs1rF115a8pU1 (AT) news (DOT) dfncis.de>, Oliver Block <oliver.block (AT) epost (DOT) de> wrote: what is the most elegent way to center an image inside a web page. "Most elegant" would be "simplest" to me -- but that also happens to be non-compliant with HTML Strict and doesn't use CSS. So the next best way is: (CSS) .imgcenter { display: inline; text-align: center; border: 0; } (HTML) <img class="imgcenter" src="...." ... The display:inline is needed so that the image gets treated like text, which can then be centered with text-align:center. |
|
Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ | (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ | ----------------------------------------------------------------------------- |
#9
| |||
| |||
|
|
So the next best way is: (CSS) .imgcenter { display: inline; text-align: center; border: 0; } (HTML) <img class="imgcenter" src="...." ... The display:inline is needed so that the image gets treated like text, which can then be centered with text-align:center. |
#10
| |||
| |||
|
|
Hi, what is the most elegent way to center an image inside a web page. The image is radomly chosen by a cgi script may be 300x400 or 400x300. Are there any alignment commands for images? tia, Oliver |
![]() |
| Thread Tools | |
| Display Modes | |
| |