NeTDeMoN wrote:
> 
> the <center> tag is cool because it aligns both inline and block
> data. Is there a way to do a css markup that does the same things
> as center does?
> 
> I know there is div.centerme {text-align: center} which only works
> on inline data and then there is div.centerme { margin-left: auto;
> margin-right: auto} or whatever for block data. Is there a way to
> do both at once?

.center, .center * {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
}

If you are only concerned with the element's children, not all of its
descendants, it is better to write

.center, .center > * {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
}

However, I warn you that this is not a reliable way of centering things,
as few browsers really understand 'auto' margins.

> 
> Is center deprecated?

Both <center> and the 'align' attribute are deprecated. This
information is readily found in the HTML specification, and
you should check there before asking in the newsgroups.

Also, your questions are more suited to 
comp.infosystems.www.authoring.html and 
comp.infosystems.www.authoring.stylesheets than here.

Reply via email to