Jump to content

migrating from markup tags to CSS


ffej2ffej
 Share

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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...