What's the HTML code for?

Whats the HTML code for align middle?

  • Answer:

    Middle alignment in an image tag is in reference to the baseline and text around it or the alignment of an image according to the surrounding element.. The align attribute of <img> is deprecated in HTML 4.01. The image tag is an inline tag and CSS rules have to be carefully applied at times to get a non-block level tag to do what you want. Centering an element requires setting a width to the exact width of the content, using a proper document type and using the CSS property: margin: 0 auto; This is done in the CSS that styles the element. Using inline CSS rules: <img style="display: block; width: 200px; height: 200px; margin: 0 auto; border: 0;" src="Path to image" alt="Text Description"> Notice that I made the image tag a block level tag with the display rule. Otherwise, it would not have centered. Better if you used an external CSS file for your CSS rules. Ron

jayteemoney at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Example: <img align="left|right|middle|top|bottom" />

Damien

just add it in a Div tag apply style in div like - <div style="text-align:center"><img src="myimage.jpg"/></div> that's it, if u attach it as background image it won't work.

k arun

Example: <img align="left|right|middle|top|bottom" />

Damien

just add it in a Div tag apply style in div like - <div style="text-align:center"><img src="myimage.jpg"/></div> that's it, if u attach it as background image it won't work.

k arun

Middle alignment in an image tag is in reference to the baseline and text around it or the alignment of an image according to the surrounding element.. The align attribute of <img> is deprecated in HTML 4.01. The image tag is an inline tag and CSS rules have to be carefully applied at times to get a non-block level tag to do what you want. Centering an element requires setting a width to the exact width of the content, using a proper document type and using the CSS property: margin: 0 auto; This is done in the CSS that styles the element. Using inline CSS rules: <img style="display: block; width: 200px; height: 200px; margin: 0 auto; border: 0;" src="Path to image" alt="Text Description"> Notice that I made the image tag a block level tag with the display rule. Otherwise, it would not have centered. Better if you used an external CSS file for your CSS rules. Ron

Shadow Knows

<... align="center" ...></...>

PCMaster

<... align="center" ...></...>

PCMaster

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.