TwitterBootstrapMvc icon indicating copy to clipboard operation
TwitterBootstrapMvc copied to clipboard

Setting modal width

Open Robelind opened this issue 10 years ago • 3 comments

Hi. I can't find a way to set the width of a modal. Using Class() or HtmlAttributes() on Modal renders the attributes on the fade div, not the modal div itself.

Robelind avatar Mar 08 '14 13:03 Robelind

assign Id to that modal .Id("my-modal") create css rule:

#my-modal .modal-dialog {
    max-width: 200px;
}

DmitryEfimenko avatar Mar 08 '14 21:03 DmitryEfimenko

This works, but it's kind of a hassle to have to have an id and a css-rule for each and every modal. Wouldn't it be better if Class() rendered to the correct div instead.

Robelind avatar Mar 18 '14 18:03 Robelind

well then, instead Id, use .Class("width-200") and the following css rule:

.width-200 .modal-dialog {
    max-width: 200px;
}

This way you'll have to create css rule just once.

DmitryEfimenko avatar Mar 18 '14 18:03 DmitryEfimenko