简体   繁体   中英

Grails page layout with twitter bootstrap

Hi I'm very new to twitter bootstrap. I have installed the plugin for grails and my .gsp file looks like this:

<html>
   <head>
      <meta name="layout" content="main"/>
      <r:require modules="bootstrap"/>
   </head>   
<body>
    <div class="alert">
        <button type="button" class="close" data-dismiss="alert">×</button>
         <h4>Warning!</h4>
         Text goes here
    </div>
</body>   
</html>

The bootstrap is working as expected. But my whole page is shifted towards left. It looks like :

在此处输入图片说明

Don't know where I'm making the mistake.

Thanks in advance.

You need to add class called container .

<body>
<div class="container">
<div class="alert">
    <button type="button" class="close" data-dismiss="alert">×</button>
     <h4>Warning!</h4>
     Text goes here
</div>
</div>
</body>

Like this... and check. Hope this helpful to you.

Link of EX

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM