You are here: Re: CSS equivalent of single-cell table ? « HTML « IT news, forums, messages
Re: CSS equivalent of single-cell table ?

Posted by Beauregard T. Shagnasty on 11/04/07 01:15

MangroveRoot wrote:

>> Of course you can't centre a float
>
> Astounding.

Liken a float to a pull-quote. Very seldom do you see a pull-quote in
the centre, but rather at one of the sides.

>> so I hope that's not your next question.
>
> Actually, it is. I can do that with the much-deprecated tables,
> why can't I do this with the much-vaunted CSS?

You can. You forgot to finish it. <g>

<div style=" align:center;
border-width:5;
border-style:inset;
background-color:red;
margin: 0 auto;
width: 10%;
">
content
</div>

Select a width that would be appropriate to your content. You can also
use em units for the width, say: width: 20em;
If you also want to centre the content, add: text-align: center;

Naturally, you would want to put the styling in a stylesheet, rather
than inline with the HTML.

You can also set borders like this, picking the colours of your choice:

border-top: 5px inset #d0d0d0;
border-left: 5px inset #d0d0d0;
border-right: 5px inset #a9a9a9;
border-bottom: 5px inset #a9a9a9;

BTW, your table example in your initial post is also the full width of
the browser window.

--
-bts
-Motorcycles defy gravity; cars just suck

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация