2012-02-08 27 views
1

內兩個元件我有以下:的CSS浮動jQuery UI的主題插件

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <title>Testing PasteHTML.com</title> 
     <link type="text/css" href="http://optdev.shellprompt.net/css/jquery-ui-1.8.1.custom.css" rel="stylesheet"> 
    </head> 
    <body> 
     <div class="notification" id="notification-message"> 
      <div class="ui-widget"> 
       <div style="padding: 0 .7em;" class="ui-state-error ui-corner-all"> 
        <span style="float: right;cursor:pointer" onclick="$x_Remove('notification-message')" class="ui-icon ui-icon-closethick"></span> 
        <div id="message" style="float:left">Invalid Login Credentials</div> 
       </div> 
      </div> 
     </div> 
    </body> 
</html> 

兩個消息和「X」 apear其父DIV之外。我如何將它們放在父母的內部?

這裏是一個演示http://pastehtml.com/view/bngl4k1th.html,我想它看起來像jQuery UI主題http://tinyurl.com/dbqg2t警報消息

回答

1

剛剛一直在通過jQuery UI主題工作,我錯過了ui-helper-clearfix類,一旦我添加它完美的工作。

0

您可以添加overflow:hidden父標籤或與clear:both屬性一個新的div,結束父標籤前。