views:

193

answers:

2

Since the old version was apparently way too hard for people to understand, here's the HTML, CSS, and JavaScript combined:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>test title</title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"&gt;&lt;/script&gt;
        <script type="text/javascript">
            $(document).ready(function(){
                $('#test').dialog({ autoOpen: false, modal: true });
                $("#test-link").click( function() {
                    $('#test').dialog('open');  
                });
            });
        </script>
        <style type="text/css">
            div#main div#test label {
                display: block;
            }
            div#main div#test input {
                padding-left: 100px;
            }
        </style>
    </head>
    <body>
        <div id="main">
            <p><a href="#" id="test-link">test</a><p>
            <div id="test" title="Submit Bug or Feature Request">
                <form>
                    <label for="test_desc">Short Description:</label>
                    <input type="text" name="test_desc" id="test_desc" value="" />
                    <input type="submit" name="" value="Submit" />
                </form>
            </div>

        </div>
    </body>
</html>

The dialog works fine, but the CSS does not. Any ideas why?

A: 

The css should work. It might be a problem with how the css rules cascade. Is there a more specific selector applying these rules like "#dialog div#test label"? Without the rest of html/css it's impossible to point out the specifics. Get firebug and see what rules are getting applied to those elements.

tom
Not sure why I got voted down here. The original question had incomplete information. It was a good guess based on the original info
tom
+1  A: 

JQuery moves a dialog's DIV in the DOM tree and wraps it in some others. Therefore the CSS selectors won't work. Using the above example you'd have to do something like this:

div.ui-dialog div#test label {
    display: block;
}
div.ui-dialog div#test input {
    padding-left: 100px;
}
fiXedd