Jump to content

migrating from markup tags to CSS


Recommended Posts

I am learning CSS and it's mostly going well. All the advantages about using CSS are realized almost immediately once you being using it. I, however, am from the old school. When you wanted something centered, you surrounded it with <center> and </center> tags. This would center ANYTHING. Pictures, tables, etc. would all be centered if they were between these tags. CSS text-align:center will center the text. Nothing else. I would like to know if there is a way to center other things or if there will be soon.I understand that <center> is deprecated and I would like to stop having to use it.Thank you in advance for your help. Jeff S.

Edited by ffej2ffej
Link to post
Share on other sites

If you want to center a block element, make sure it has a fixed width, then set the left and right margins to "auto".

.container {    width: 800px;    margin: 0 auto;}

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...