Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
谷歌地球插件中的CSS_Css_Kml_Google Earth_Google Earth Plugin - Fatal编程技术网

谷歌地球插件中的CSS

谷歌地球插件中的CSS,css,kml,google-earth,google-earth-plugin,Css,Kml,Google Earth,Google Earth Plugin,只是想知道是否有可能通过外部/链接的.css文件而不是内联样式来设计弹出气球的样式?是的,我以前做过,这可能会很棘手。您需要使用firebug来确定需要获取的选择器,在CSS中,您必须非常具体地覆盖它们,有时甚至可能需要使用!这条规则很重要 Natalie我通常做的是为我的placemark气球创建一个气球样式,它包含一个包装器div,带有一个CSS类,如earth balloon,然后可以直接从包含页面中设置样式 例如,KML看起来像: <?xml version="1.0" encod

只是想知道是否有可能通过外部/链接的
.css
文件而不是内联样式来设计弹出气球的样式?

是的,我以前做过,这可能会很棘手。您需要使用firebug来确定需要获取的选择器,在CSS中,您必须非常具体地覆盖它们,有时甚至可能需要使用!这条规则很重要


Natalie

我通常做的是为我的placemark气球创建一个气球样式,它包含一个包装器
div
,带有一个CSS类,如
earth balloon
,然后可以直接从包含页面中设置样式

例如,KML看起来像:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Document>
    <Style id="foo">
      <BalloonStyle>
        <text><![CDATA[
        <div class="earth-balloon">
          $[description]
        </div>
        ]]></text>
      </BalloonStyle>
    </Style>
    <Placemark>
      <styleUrl>#foo</styleUrl>
      <name>Bar</name>
      <description><![CDATA[
        Some <em>HTML</em> here.
      ]]></description>
      <Point>
        <coordinates>-122,37</coordinates>
      </Point>
    </Placemark>
  </Document>
</kml>
<html>
<head>
  <link rel="stylesheet" type="text/css" href="styles.css"/>
  <!-- Earth API stuff goes here -->
</head>
<body>
  <div id="map3d"></div>
</body>
</html>

希望有帮助

太好了,我该怎么做,外部文件需要链接到哪里?你也可以给我举个例子。当做k是我很久以前研究的东西,它有点变化,但应该给你一个想法,看看firebug和banklocator中的代码。cssheh看起来你不能把html放在注释中,只能放在答案中:)-url是
.earth-balloon {
  font-family: Georgia, serif;
}

.earth-balloon em {
  color: red;
}