google maps v3 change size of infowindow

前端 未结 6 1622
盖世英雄少女心
盖世英雄少女心 2021-02-04 14:25

I would like to set the size of an infowindow to fit the content inside. The standard infowindow is too wide I tried to use maxWidth but it doesn\'t seem to work. What is the be

6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-04 14:39

    JFrancis answers is the right one, just don't forget to add "!important" in your CSS when you set the width! This might look like a minor thing, but if you don't do it, your CSS will simply get overwritten!

    #infoWindow {
        width: 150px !important;
    }
    

提交回复
热议问题