[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-09 Thread mbraybrook
It is not a good idea, in my experience, to use floats in that way, but if it works - consistently - then i guess there is no real reason not to, it just doesn't feel right... I would avoid going down the road of using inline-block, IE will not completely support it until IE8 is released, and

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread mbraybrook
try: span style=width:80px; background-color:#00FF00; display:block;A/ span Does that work? M On Nov 7, 3:45 pm, nmiddleweek [EMAIL PROTECTED] wrote: Hello, I've got a SPAN tag which is set to 80px... span style=width:80px; background-color:#00FF00;A/span The contents of the SPAN is a

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread Andy Matthews
Span is an inline element and cannot have a width applied to it, unless you display it as a block, which would sort of defeat the purpose of having it inline. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nmiddleweek Sent: Friday, November

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread nmiddleweek
Ah right, ok... Cheers for the replies... I'm guessing applying display:block is the same as just making it a DIV? On Nov 7, 3:48 pm, Andy Matthews [EMAIL PROTECTED] wrote: Span is an inline element and cannot have a width applied to it, unless you display it as a block, which would sort

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread nmiddleweek
Yes that works... What I'm trying to do is display a SPAN atg at the end of an Input text field of a fixed size. If I set the display to block, it is forcing itself to be on the next line. Have you got any idea on how I can do this? Cheers, Nick On Nov 7, 3:48 pm, mbraybrook [EMAIL

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread mbraybrook
This works: input type=text style=float:left;/span style=width:80px; background-color:#00FF00;display:block;float:left;A/span However... I feel bad telling you that - this is bad markup - perhaps you could explain why you are trying to do this, or what the bigger picture here is? As stated by

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread Hector Virgen
Wrap the input in a div with and set the div's position to relative. Then, add the span as as a div, set the width, and position it absolutely. Its absolute position will be relative to the container div, not the page. div style=position: relative; input type=text name=name style=width:

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread Andy Matthews
That's a LOT of markup. You could actually use an input field if you just want to set a background color an some text. It might look like this: input type=text name=name style=width: 100px; / input type=text name=name value=some text style=width: 80px;background: #ff; border: 0px;height:

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread Liam Potter
the most simple way to do this, is to simply apply display:block on the span. span style=display:block;width:80px;background:#00FF00;A/a that will fix it all. Andy Matthews wrote: That's a LOT of markup. You could actually use an input field if you just want to set a background color an

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread Andy Matthews
Actually that will NOT fix it all. That makes the span into a block level element which will force it to the next line. andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Liam Potter Sent: Friday, November 07, 2008 11:08 AM To:

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread Liam Potter
display:inline-block; Andy Matthews wrote: Actually that will NOT fix it all. That makes the span into a block level element which will force it to the next line. andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Liam Potter Sent:

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread Liam Potter
no, in IE it works only on things that are natively inline. For Firefox 2 you will need to use |display:-moz-inline-stack; but FF3 supports inline-block, opera, safari and konqueror all support it.| nmiddleweek wrote: Hi Liam, Thanks for your input... Is inline-block IE only? On Nov 7,

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread nmiddleweek
Hi Liam, Thanks for your input... Is inline-block IE only? On Nov 7, 5:20 pm, Liam Potter [EMAIL PROTECTED] wrote: display:inline-block; Andy Matthews wrote: Actually that will NOT fix it all. That makes the span into a block level element which will force it to the next line. andy

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread nmiddleweek
Why is this bad markup? it works... On Nov 7, 4:27 pm, mbraybrook [EMAIL PROTECTED] wrote: This works:  input type=text style=float:left;/span style=width:80px; background-color:#00FF00;display:block;float:left;A/span However... I feel bad telling you that - this is bad markup - perhaps

[jQuery] Re: span tag is width:80px but is only showing the width of contents?

2008-11-07 Thread nmiddleweek
Thanks... I was just playing with float but I set the input to float:left and the span to float:right thinking it was something to do with justification. I kind of got it working but it didn't look right in Chrome. Perhaps your way works better but I'll sack it off if it's bad coding... Thanks