1

In quirks mode (IE) the following code will function correctly. In standards compliant mode, this code will only show the text of the nested span, but it will not be given 100% for width. Is there a way to force the nested inline-block span to set its width to the div size, and if so is there a way to do it without changing the html code? Thanks for any help.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html>
<head>
    <style>
        span {display:inline-block;}
    </style>
<head>
<body>
    <div>
        <span>
            <span style='width:100%; text-align:center;'>
                Blah
            </span>
        </span>
    </div>
</body>

1 Answer 1

1

The parent (span) don't have any width. Just set it and you resolve your problem

div span { width:100% }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.