Image not centering on the page

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
User avatar
rudy
Posts: 3
Joined: Mon Jul 16, 2012 6:01 pm

Image not centering on the page

Post by rudy »

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title></title>
</head>

<body>
<img src="C:/Documents and Settings/Larry/My Documents/images/200px-USB_Icon.svg.png" width="200" height="96" align="middle" border="0" alt="welcome" />
</body>

</html>

When using the code generated by your product as shown above, and I click to preview, the image is on the left of the page - thought it would be centered in the middle of the page and also the alt text does not show up when the image is moused over. What am I missing? Using IE to preview.

When I preview it in FireFox, the image doesn't show at all but the alt tage "welcome" shows up and it is aligned left on the page.
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Image not centering on the page

Post by Aivars »

Align centers image according to surrounding text, align=middle aligns text line with middle of image (vertically). Read this: http://www.htmlcodetutorial.com/images/_IMG_ALIGN.html

Regarding Alt, read this: http://www.searchenginejournal.com/imag ... ence/6930/

Read this on centering images: http://webdesign.about.com/od/beginning ... 012207.htm
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Image not centering on the page

Post by Aivars »

To make sure the local images (from your computer) are displayed in all browsers, add file:/// in front of image path, <img src="file:///C:/Documents and ... - however note that this will not work once you upload your page online.
Blumentals Software Programmer
pety
Posts: 187
Joined: Fri Mar 02, 2012 7:17 pm

Re: Image not centering on the page

Post by pety »

Put image into a praragraph:

Code: Select all

<p>
    <img src="/pat/to/image.jpg" width="200" height="96" align="middle" border="0" alt="welcome" />
</p>
Post Reply