aligning DIV in css - Noob Question.

aligning DIV in css - Noob Question.

am 25.05.2007 17:35:52 von jobs at webdos

sorry for the noob question.

I know I can position a div tag in hmtl as such..


hello


is there any way to do all of this in 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.


hello


css:

#ccc
{
position:absolute;
left:200px;
top:400px;
width:200px;
height:300px;
border: ghostwhite thin ridge;
color: red;
background-color:blue;
}

FYI, i doing all of this in asp.net 2.0.

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

Thank you for any help or information!

Re: aligning DIV in css - Noob Question.

am 25.05.2007 17:58:02 von Ben C

On 2007-05-25, jobs wrote:
> sorry for the noob question.
>
> I know I can position a div tag in hmtl as such..
>
>


> hello
>


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.
>
>

> hello
>

>
> 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.

Re: aligning DIV in css - Noob Question.

am 25.05.2007 18:11:36 von John Hosking

jobs wrote:
> sorry for the noob question.

We're all noobs sometime. :-)

>
> I know I can position a div tag in hmtl as such..

You mean a div *element* (which is delimited in the code by tags). You
also mean HTML.

>
>


> hello
>


Only some of the above is valid CSS; some is just made up.

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

Well, that was dressed as CSS (even if it wasn't actually valid), so you
seem to think you're asking for the CSS equivalent of 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.
>
>

> hello
>

>
> css:
>
> #ccc
> {
> position:absolute;
> left:200px;
> top:400px;
> width:200px;
> height:300px;
> border: ghostwhite thin ridge;
> color: red;
> background-color:blue;
> }

Ah, I think I'm starting to get what you're wanting. You know you can
use inline styles (your "in hmtl as such"), and now you want to use
embedded or external styles.

Without a URL pointing to the page you're having "no luck" with, I can't
tell you what's wrong. But get in the habit of validating your code,
http://validator.w3.org/ for markup, http://jigsaw.w3.org/css-validator/
for CSS.

>
> FYI, i doing all of this in asp.net 2.0.

No guts, no glory, I guess. You'll need to check the finished results
produced by any tool you use.

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

Less often than you think. For paragraphs, use

, for headings use

,

, etc., for lists of thins use list markup. A div is a generic
block-level element that you can use when no other markup is
appropriate. A span is an in-line element that you can use when no other
markup is appropriate. Both of these elements (div especially) are often
misused when a more semantically meaningful element should be used. See
the specs at http://www.w3.org/TR/html401/struct/global.html#h-7.5.4 .

>
> Thank you for any help or information!

You're welcome. Hope this helps.

--
John

Re: aligning DIV in css - Noob Question.

am 26.05.2007 00:21:46 von dorayme

In article <46570aba$1_2@news.bluewin.ch>,
John Hosking wrote:

> jobs wrote:
> > sorry for the noob question.
>
> We're all noobs sometime. :-)

There should be a newsgroup where it is perfectly ok to ask
genuine questions no matter how clueless they look. Where the
experts are all nice mammas who make great chicken soup and
nothing is too much trouble. Imagine for example JK in an apron
over a hot stove, go on, try it. Perhaps there is a little corner
in heaven where this is actually so.

--
dorayme

Re: aligning DIV in css - Noob Question.

am 26.05.2007 09:45:41 von Adrienne Boswell

Gazing into my crystal ball I observed dorayme
writing in news:doraymeRidThis-
EE426D.08214626052007@news-vip.optusnet.com.au:

> In article <46570aba$1_2@news.bluewin.ch>,
> John Hosking wrote:
>
>> jobs wrote:
>> > sorry for the noob question.
>>
>> We're all noobs sometime. :-)
>
> There should be a newsgroup where it is perfectly ok to ask
> genuine questions no matter how clueless they look. Where the
> experts are all nice mammas who make great chicken soup and
> nothing is too much trouble. Imagine for example JK in an apron
> over a hot stove, go on, try it. Perhaps there is a little corner
> in heaven where this is actually so.
>

I'm a nice mama and I make great Salmon en Papillote with Green Sauce and
Risotto Milano followed by a raspberry chocolate mousse trifle. That's
not too much trouble. I don't have an apron, but I have 18/10 stainless
pots and pans.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Re: aligning DIV in css - Noob Question.

am 26.05.2007 10:18:44 von dorayme

In article ,
Adrienne Boswell wrote:

> Gazing into my crystal ball I observed dorayme
> writing in news:doraymeRidThis-
> EE426D.08214626052007@news-vip.optusnet.com.au:
>
> > In article <46570aba$1_2@news.bluewin.ch>,
> > John Hosking wrote:
> >
> >> jobs wrote:
> >> > sorry for the noob question.
> >>
> >> We're all noobs sometime. :-)
> >
> > There should be a newsgroup where it is perfectly ok to ask
> > genuine questions no matter how clueless they look. Where the
> > experts are all nice mammas who make great chicken soup and
> > nothing is too much trouble.
> >
>
> I'm a nice mama and I make great Salmon en Papillote with Green Sauce and
> Risotto Milano followed by a raspberry chocolate mousse trifle. That's
> not too much trouble. I don't have an apron, but I have 18/10 stainless
> pots and pans.

My God, that dish sounds good! Time to at least go and see
'Babbette's Feast' again.

--
dorayme