Jump to content
ownage

<div>

Recommended Posts

isnt that the same as <span></span> i see people using them for tables and stuff, why not just use the table elements or the header elemetns? whats the benifet

Share this post


Link to post
Share on other sites

<span> is an in-line element and <div> is a block-level element. Use spans inside of div's.Tables are not designed to structure a page, although they do work for that. Do it however you want, but there are distinct advantages to div's and css. File size and speed of loading for one thing. Tables are bulkier and take longer to load. They are more difficult to modify.

Share this post


Link to post
Share on other sites

does anyone know how to take the whole division <div>......</div> and center it? I tried align="center" and that didnt work. any tips? thanks!

Share this post


Link to post
Share on other sites

A div is a block-level element by default, which stretches 100% width, so if you want to center it you'll need to reduce the width so that the div is smaller then it's container. Then you can use auto margins to center the div inside its container.<div style="width: 500px; margin: 0 auto;">

Share this post


Link to post
Share on other sites

You need too much darned syntax for a table.<table><tr><td>content</td></tr></table>COMPARE:<div>content</div>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...