Could someone please correct my syntax to set a control to float?

MyDivID.style.position="float"

I get an error using Office 2003; Win XP; and IE 6.

Thanks for your assistance.

Re: Can a Div take a "Float" position? by mayayana

mayayana
Thu May 10 20:32:13 CDT 2007

Float and position are both CSS properties. In the IE
DOM float is styleFloat. So you can have

MyDivID.style.position = [absolute | relative | static |fixed | inherit]
or
MyDivID.style.styleFloat = [left | right | none]

(I'm not sure whether IE recognizes all 5 position options.)


> Could someone please correct my syntax to set a control to float?
>
> MyDivID.style.position="float"
>
> I get an error using Office 2003; Win XP; and IE 6.
>
> Thanks for your assistance.



Re: Can a Div take a "Float" position? by Evertjan

Evertjan
Fri May 11 02:49:46 CDT 2007

mayayana wrote on 11 mei 2007 in microsoft.public.scripting.vbscript:

>> Could someone please correct my syntax to set a control to float?
>>
>> MyDivID.style.position="float"
>>
>> I get an error using Office 2003; Win XP; and IE 6.
>>
>> Thanks for your assistance.

[Please do not toppost on usenet]

> Float and position are both CSS properties. In the IE
> DOM float is styleFloat. So you can have
>
> MyDivID.style.position = [absolute | relative | static |fixed | inherit]
> or
> MyDivID.style.styleFloat = [left | right | none]
>
> (I'm not sure whether IE recognizes all 5 position options.)

MyDivID.style.cssFloat

vs

MyDivID.style.styleFloat

The only odd style is float, which is a reserved word in many languages,
including JavaScript. As a result, the float style must be set using
cssFloat in standards compliant browsers, and styleFloat in Internet
Explorer (some standards compliant browsers also provide this as well).
Simply set both of them. It will not cause any problems, and will work in
all possible browsers.

<http://www.howtocreate.co.uk/tutorials/javascript/domcss>

[the other odd one is .style.className, btw]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: Can a Div take a "Float" position? by mayayana

mayayana
Fri May 11 09:05:25 CDT 2007

> The only odd style is float, which is a
> reserved word in many languages

I meant odd in the sense that many of the IE DOM
style properties are not the same as straight CSS.
So for someone trying to learn the DOM it gets very
confusing. They have to learn two different systems.

That's an interesting point, though. I've never heard
of anything like "cssfloat" and it's not in Eric Meyer's
original CSS1/pre CSS2 book. Is it a recent
development?
I also don't see why it would matter. The context
defines the word. Maybe there's a case where the word
float would be absolutely ambiguous as to whether
it's script or CSS, but I can't think of an example.



Re: Can a Div take a "Float" position? by Evertjan

Evertjan
Fri May 11 09:08:38 CDT 2007

mayayana wrote on 11 mei 2007 in microsoft.public.scripting.vbscript:

>> The only odd style is float, which is a
>> reserved word in many languages
>
> I meant odd in the sense that many of the IE DOM
> style properties are not the same as straight CSS.
> So for someone trying to learn the DOM it gets very
> confusing. They have to learn two different systems.
>
> That's an interesting point, though. I've never heard
> of anything like "cssfloat" and it's not in Eric Meyer's
> original CSS1/pre CSS2 book. Is it a recent
> development?
> I also don't see why it would matter. The context
> defines the word. Maybe there's a case where the word
> float would be absolutely ambiguous as to whether
> it's script or CSS, but I can't think of an example.

The same goes for className.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: Can a Div take a "Float" position? by mayayana

mayayana
Fri May 11 10:17:03 CDT 2007

You mentioned "className" in both your posts
as being a problem. I don't know what you're
talking about.

>
> >> The only odd style is float, which is a
> >> reserved word in many languages
> >
> > I meant odd in the sense that many of the IE DOM
> > style properties are not the same as straight CSS.
> > So for someone trying to learn the DOM it gets very
> > confusing. They have to learn two different systems.
> >
> > That's an interesting point, though. I've never heard
> > of anything like "cssfloat" and it's not in Eric Meyer's
> > original CSS1/pre CSS2 book. Is it a recent
> > development?
> > I also don't see why it would matter. The context
> > defines the word. Maybe there's a case where the word
> > float would be absolutely ambiguous as to whether
> > it's script or CSS, but I can't think of an example.
>
> The same goes for className.
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)



Re: Can a Div take a "Float" position? by Evertjan

Evertjan
Fri May 11 13:49:30 CDT 2007

mayayana wrote on 11 mei 2007 in microsoft.public.scripting.vbscript:
>> >> The only odd style is float, which is a
>> >> reserved word in many languages
>> >
>> > I meant odd in the sense that many of the IE DOM
>> > style properties are not the same as straight CSS.
>> > So for someone trying to learn the DOM it gets very
>> > confusing. They have to learn two different systems.
>> >
>> > That's an interesting point, though. I've never heard
>> > of anything like "cssfloat" and it's not in Eric Meyer's
>> > original CSS1/pre CSS2 book. Is it a recent
>> > development?
>> > I also don't see why it would matter. The context
>> > defines the word. Maybe there's a case where the word
>> > float would be absolutely ambiguous as to whether
>> > it's script or CSS, but I can't think of an example.
>>
>> The same goes for className.

Please do not toppost on usenet.
Second request to you, mayayana.

> You mentioned "className" in both your posts
> as being a problem. I don't know what you're
> talking about.

I have no problems with that,
nor with the DOM version of float,
why do you think I have?

'class' and 'float' css are not used in the DOM style version,
but replaced by className and cssfloat/styleFloat.

If you know, it is not a problem,
if you don't, it could be.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)