You are here: Re: aligning DIV in css - Noob Question. « HTML « IT news, forums, messages
Re: aligning DIV in css - Noob Question.

Posted by Ben C on 05/25/07 15:58

On 2007-05-25, jobs <jobs@webdos.com> wrote:
> sorry for the noob question.
>
> I know I can position a div tag in hmtl as such..
>
> <div id=ccc style="align:bottom;position:absolute;left:1px;width:
> 200px;height:300px;border: ghostwhite thin ridge;float-right">
> hello
></div>

Almost. There's no align property, but you might be thinking of
"vertical-align". And you need float: right, not float-right.

> is there any way to do all of this in css?

You have already done it in CSS. The string inside the style attribute
_is_ CSS.

> I tried this with no luck. I know the css is taking some effect
> because i set background-color in the body entry and it worked.
>
><div id="ccc">
> hello
></div>
>
> css:
>
> #ccc
> {
> position:absolute;
> left:200px;
> top:400px;
> width:200px;
> height:300px;
> border: ghostwhite thin ridge;
> color: red;
> background-color:blue;
> }

That looks fine, there's no reason why it shouldn't work. You need to
post a URL.

> Another question, when should I use DIV and when should I use SPAN?

Whichever you want really. Usually DIV for block-level things and SPAN
for inline-level things. Use the other HTML elements unless there isn't an
appropriate one for what the element contains.

 

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

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