GVKun编程网logo

将Google Maps Container DIV的宽度和高度设置为100%(谷歌targetmap 尺寸分布图)

9

对于想了解将GoogleMapsContainerDIV的宽度和高度设置为100%的读者,本文将是一篇不可错过的文章,我们将详细介绍谷歌targetmap尺寸分布图,并且为您提供关于android–A

对于想了解将Google Maps Container DIV的宽度和高度设置为100%的读者,本文将是一篇不可错过的文章,我们将详细介绍谷歌targetmap 尺寸分布图,并且为您提供关于android – AlertDialog AppCompat的宽度和高度、Bootstrap4将元素的宽度设置为50%、c# – 将HTML窗体的宽度设置为100%,就像在HTML中一样、css – Div为页面宽度的100%,减去右边固定div的宽度(但没有设置边距右)的有价值信息。

本文目录一览:

将Google Maps Container DIV的宽度和高度设置为100%(谷歌targetmap 尺寸分布图)

将Google Maps Container DIV的宽度和高度设置为100%(谷歌targetmap 尺寸分布图)

我加载了Google Maps API v3,并在中打印了Google Map
div。但是,当将width&height设置为100%并且是auto时,我看不到地图。

这是HTML代码段。

<!-- Maps Container --><div id="map_canvas"></div>

有没有解决此问题的方法?

答案1

小编典典

如果要用它覆盖整个页面,则必须将所有父容器的宽度设置为100%。您必须至少为#content div的宽度和高度设置一个绝对值。

body, html {  height: 100%;  width: 100%;}div#content {  width: 100%; height: 100%;}

android – AlertDialog AppCompat的宽度和高度

android – AlertDialog AppCompat的宽度和高度

我对AlertDialog的客户风格如下:

<style name="Testing.Dialog" parent="Theme.AppCompat.Light.Dialog.Alert">
    <item name="colorAccent">@color/color_accent</item>
    <item name="android:textColorPrimary">@color/text_color_primary</item>
    <item name="android:background">@color/color_primary</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

我需要更改宽度和高度,因为它在我的平板电脑上太大了.有任何想法吗?

下面的代码不能正常工作:

   <item name="windowMinWidthMajor">@dimen/abc_dialog_min_width_major</item>
   <item name="windowMinWidthMinor">@dimen/abc_dialog_min_width_minor</item>

解决方法:

如果是自定义对话框,则只能在新创建的XML文件中设置高度和宽度.但如果你使用AlertDialog.builder,那么使用它.

AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(layout);
builder.setTitle("Title");
alertDialog = builder.create();
alertDialog.show();
alertDialog.getwindow().setLayout(600, 400); //Controlling width and height.

并按照this希望它可以帮助你.

Bootstrap4将元素的宽度设置为50%

Bootstrap4将元素的宽度设置为50%

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link rel = stylesheet href = https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css>
      <script src = https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js></script>
      <script src = https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js></script>
   </head>
   <body>
      <div class = container>
         <h3>Set element width</h3>
         <div class = w-100 bg-danger>normal width</div>
         <div class = w-50 bg-success>Width is 50%</div>
      </div>
   </body>
</html>

c# – 将HTML窗体的宽度设置为100%,就像在HTML中一样

c# – 将HTML窗体的宽度设置为100%,就像在HTML中一样

我有一个 Windows窗体,客户端需要以任何分辨率全屏显示(需要看起来像一个网页).但问题是使窗体宽度为100%.

有什么建议?

解决方法

您可以使用FormWindowState在加载时最大化表单.

this.WindowState = FormWindowState.Maximized;

css – Div为页面宽度的100%,减去右边固定div的宽度(但没有设置边距右)

css – Div为页面宽度的100%,减去右边固定div的宽度(但没有设置边距右)

我把头发拉了出来因为我无法解决这个问题.我正在开发一个wiki.典型页面右侧有一个侧栏,宽度固定.此侧边栏的左侧是文本,div,表格等(页面内容).基本上,我希望一切都在全宽 – 这意味着如果它在侧边栏旁边,它应该是全宽减去侧边栏的长度.如果它不在侧边栏旁边,则应该是页面的整个宽度.像这样:

_______________________________
|                          ___  |
| text text text text te- |   | |
| xt text text text text. | S | | 
| ______________________  | B | |
| |                     | |   | |
| |        table        | |___| |
| |          or         |       |
| |         div         |       |
| |_____________________|       |
|                               |
| more text text text text tex- |
| t text text text text text t- |
| ext text text text text text  |
| ____________________________  |
| |        another table      | |
| |             or            | |
| |            div            | |
| |___________________________| |
|_______________________________|

在文本的情况下,它完全包围侧边栏.如果我有一个超长句子,它一直到侧边栏的左边,然后打破一个新的行.如果我有一个超长段落,所有文本都会在侧边栏旁边突然出现,并且也会在它下面.

但是,我遇到的问题是当我想在侧边栏的左侧放置div时.设置为100%时,div不会考虑侧边栏的宽度并扩展到页面的整个宽度,从而与侧边栏重叠.通常我只是将div设置为侧边栏宽度的右边距.但是,出于我的目的,这是不可行的,因为在不同的屏幕分辨率下,div可能在侧边栏下面的页面上较低,因此div的右边会有一个空白的间隙(加上它只是更容易编码,以解决这个问题,所以页面的div知道它们应该有多宽.)例如,在我上面的文字图片中,如果页面较薄,因为它的屏幕分辨率较低,则第一个框可能位于侧边栏下方.使用侧边栏的边距右侧,这意味着框的右侧会有很大的间隙,并且它不会是页面的整个宽度.

这是我正在使用的代码.

<html>
<head>
<style type="text/css">#sidebar {
float: right;
width: 250px;
height: 200px;
border: 1px solid red;
}

#la {
border: 1px solid green;
width: 100%;
}
</style>
</head>
<body>

<div id="content">

    <div id="sidebar">Sidebar with fixed width</div>

    <p>The sun is a star.</p>
    <p>It's yellow.</p>
    <p>It's very hot.</p>

    <div id="la">This div is next to the sidebar and should bump up right next to its left side,as in,100% of the page minus the width of the sidebar. It should not overlap the sidebar. This is not something that can just be done automatically with margin-right using the width of the sidebar because it might not actually be next to the sidebar on certain screen resolutions.</div>

    <p>The sun is a star.</p>
    <p>It's yellow.</p>
    <p>It's very hot.</p>

    <div id="la">This div is NOT next to the sidebar on most screen resolutions - it is under it where there is nothing to the right of it,so it should be the full width of the page.</div>


</div>

</body>
</html>

我希望有一种方法可以做到这一点,如果东西旁边的东西,如div中的表,它将在页面的最大宽度减去侧边栏的宽度.如果它不在侧边栏旁边,那么它就是页面的整个宽度.我想我只是希望其他所有内容都像文本一样 – 它会直接转到它右侧的任何内容(如果侧边栏不在那里,可以是侧边栏,如果侧边栏不在那里,可以是页面右侧).

先感谢您!

总结

以上是小编为你收集整理的css – Div为页面宽度的100%,减去右边固定div的宽度(但没有设置边距右)全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

关于将Google Maps Container DIV的宽度和高度设置为100%谷歌targetmap 尺寸分布图的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于android – AlertDialog AppCompat的宽度和高度、Bootstrap4将元素的宽度设置为50%、c# – 将HTML窗体的宽度设置为100%,就像在HTML中一样、css – Div为页面宽度的100%,减去右边固定div的宽度(但没有设置边距右)等相关知识的信息别忘了在本站进行查找喔。

本文标签: