How can I change the default width of a Twitter Bootstrap modal box?

后端 未结 30 2742
醉酒成梦
醉酒成梦 2020-11-27 08:38

I tried the following:

   
30条回答
  •  悲&欢浪女
    2020-11-27 09:13

    If you want something that does not break the relative design try this:

    body .modal {
      width: 90%; /* desired relative width */
      left: 5%; /* (100%-width)/2 */
      /* place center */
      margin-left:auto;
      margin-right:auto; 
    }
    

    As, @Marco Johannesen says, the "body" before the selector is so that it takes a higher priority than the default.

提交回复
热议问题