what is the diffrance between Align and float ?
text-align only affects
text-align only affects inline elements (text, images). There are three options: left, center and right.
Floats can be applied to both block and inline elements and causes surrounding content to wrap around the floats. Floats are also taken out of the document flow. With floats, there are only two options (other than none) - left and right.
vertical-align is obviously vertical, not horizontal.
align and float
thanks tyseen
i want to know basic diffrance...u r talking about text-aligment
i want to know when we write
then what is the diffrance.....
Don't use
Don't use align="left/right"; that attribute is deprecated - that's what CSS is for.
align and float
k...
i knw but whats the diffrace tell me......
Well, as he said, floats are
Well, as he said, floats are taken (partially) out of the document. When you used to do align=left or right, I'm pretty sure it didn't. Aligning in the old days was for moving blocks to the furthest edge of the inside of their containers, while text-align worked with inline elements. As Tyssen said, floats were made in CSS to work with both.
Initially floats were supposed to imitate this thing in print where, if there's an image to one side, the text of the article can kinda wrap around it. Floats were quickly used for positioning whole big chunks of pages.
I never used align since it was already deprecated before I started writing HTML, but from what I've seen, it simply moves block elements to one side, the other, or center. For modern block centering, give the block a width and margin: 0 auto; (the first number doesn't have to be 0, just means number for top-bottom margins... you can also set them manually like margin: 10px auto 20px, which is 10px top margin, auto on the sides, 20px bottom margin. Both sides must be "auto" for centering to work). I'm actually not sure how align=center centered things...
Thanks
thanks a ton!
thanks for ur detail description..it really helps me.