Does anyone know why the width of the span containing text “ABC” is being returned 0.
1) Happens only in Firefox.
2) If i remove a span in between, it works ok. (http://jsfiddle.net/3BFGU/30/)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not sure why – it might be a bug; however, …
Span’s by default shouldn’t have any width properties, of course they eventually do after the browser renders it. What you could do is make them block-like elements, which should fix it:
Edit:
Something else that’s interesting is if you delete all the white-space between the ABC span and it’s wrapper, it will work properly. This might have something to do with the white-space and wrapping. The browser might not be able to give a width because the container might start on one line and end on another. That might explain why making it a block fixes it, since making the container a block, might keep the entire container together.