Page 1 of 1

Image does not centre in preview

Posted: Mon Feb 07, 2005 7:37 am
by Tode
I've tried various ways to centre an image which is not in a table but none of them seem to work in the preview window.
For example, defining a centre style and applying it to a <p>:

Code: Select all

 
defined in style section in head:
.cent
    {
    text-align:center;
    margin-top:0px;
    margin-bottom:0px;
    padding:0px;
    }
...
<p class="cent"><img  (etc.) ...></p>
This doesn't work in the preview window although it works in both Mozilla and IE6 and looks valid to me.
Tode

Posted: Mon Feb 07, 2005 8:48 am
by Albert Wiersch
Hello Tode,

The integrated web browser uses the same engine as IE so if it works in IE, then it should work in the integrated web browser.

I created the following test document and the image did display in the center in the preview browser:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Test</title>
	<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
	<meta name="generator" content="CSE HTML Validator Professional (http://www.htmlvalidator.com/)">
<style type="text/css"><!--
.cent
    {
    text-align:center;
    margin-top:0px;
    margin-bottom:0px;
    padding:0px;
    }
--></style>
</head>
<body>
<p class="cent"><img src="http://www.htmlvalidator.com/jpg/box/box4_150.jpg"></p>
</body>
</html>
Please try the above and let me know if it works. I'd be surprised if it doesn't work. By the way, it was tested with IE 6.0 installed.

Posted: Mon Feb 07, 2005 9:33 am
by Tode
Sorry! I forgot that you have to press the preview button on the inbuilt browser, i.e., when you close the browser window its temporary page remains open. I think I must have been looking at an old preview.
Thanks for checking.
Tode