Table to Div, HTML attributes to CSS styles

by 4 replies
5
This has been the one thing that has been bugging me for a while.

If I try to create a css style rule that is the equivalent of this:

<border="0" cellpadding="0"
cellspacing="0" width="411" align="center">

What would it be?

Especially, what would I use for: align="center" ?
I'm trying to find the equivalent while using KompoZer.
The best I can seem to find is "text-align: center", but that only affects the enclosed text, not the box containing the text. And that's what I want to do, I want to center the "box" containing the text.

Thanks!

Judy
#website design #css #div #html #styles #table
  • My friend Anand Capur, owner of boostplatform.com, provided me the solution for the centering problem:

    either:
    margin-left: auto;
    margin-right: auto;
    width: WIDTH;

    or,

    display: block;
    margin-left: auto;
    margin-right: auto;

    THANKS, Anand!
  • try this:

    border: 0;
    margin: 0;
    padding: 0;
    text-align: center;
    width: 411px;
  • This gives the best explanation of how to do this that I've seen so far, I think: Max Design - CSS Centering - fun for all!
  • you can use something like:

    width:411px;
    margin:0 auto;

Next Topics on Trending Feed