tags:

views:

68

answers:

3

I am currently building multiple websites with visual studio 2010 using c#. The only error (messages) i have left or with img align, div align and <a name atrributes...which is considered outdated. A newer construct is recommended.

The sites still work but since i am in the learning process i want 0 errors/messages...I cannot find anywhere online that states what the new construct is that replaces these.

Can anyone help?

+1  A: 

Use Cascading Style Sheets instead of HTML formatting.

The newer construct: .rule { margin: 0px auto; }

BlueCode
I have external css style sheet i am using, figured it was something with css just didnt know what...
W S G Electronics
I don't think this is what the OP is looking for: This will right align the entire element but only if it has a fixed width
Pekka
I am trying to align images either to the left center or right of a page. and also align text to the left right or in between images, or just in general...i use the div align or img align html code which works fine but outdated. also using external style sheet...
W S G Electronics
+2  A: 

You should be using CSS for styling your web pages - this includes alignment.

Oded
+2  A: 

The equivalent of align for images is float, for div elements it is either margin or text-align depending on if you are dealing with the block itself or some inline content inside it. You can see an example on (full disclosure time) my website. Left and right block alignment is by setting the left and right margins to 0/auto or auto/0 instead of auto/auto. Left and right inline alignment is with left or right instead of center for text align.

Named anchors have been superseded by id on a generic element.

So while you might have previously written:

<p><a name="example">The quick brown fox jumped over the
lazy dog</a></p>

or, if you were following the bad practice of linking to a point instead of something notable:

<p><a name="example"></a>The quick brown fox jumped over the
lazy dog</p>

you would now write:

<p id="example">The quick brown fox jumped over the
lazy dog</p>
David Dorward
+1 care to elaborate on `text-align` with an example? Then this is the best answer, deleting mine
Pekka