TwitterBootstrapMvc
TwitterBootstrapMvc copied to clipboard
Setting modal width
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.
assign Id
to that modal .Id("my-modal")
create css rule:
#my-modal .modal-dialog {
max-width: 200px;
}
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.
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.