小编hap*_*rts的帖子

启用 :hover on margin

是否有可能在对象的“边缘区域”上启用 :hover css 效果?我发现了一个肮脏的解决方案,里面有一个额外的 div,但是这个简单的结构有没有更优雅的东西:

<ul>
  <li><a>Hello</a></li>
  <li><a>Hello</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)

CSS

ul {
  list-style: none; 
  margin: 0px; 
  padding: 0px;
}

li {
  margin: 5px 100px;
  background-color: #f1f1f1;
}

li:hover a {
  color: red;
}

#dirty {
  padding: 0px 100px;
  margin: 0px -100px;
}
Run Code Online (Sandbox Code Playgroud)

嘿是我的工作脏例子:https : //jsfiddle.net/equalsound/wn4ctxvh/

如果可能的话,只有 css 的解决方案会很可爱。

html css css-selectors

5
推荐指数
1
解决办法
8521
查看次数

在谷歌地图 APIV3 中使用 geojson 加载每个点的自定义图标

我已经使用谷歌地图有一段时间了,并且遇到了 kml 层的限制(没有鼠标悬停,只能点击)

所以我想我应该尝试一下数据层(geojson)

我似乎无法弄清楚如何更改图标(标记图像)。

我可以将所有标记更改为特定图像,但我希望能够根据我的数据库生成的 feature.property. 来使用 8 个不同图像之一

 map.data.loadGeoJson('http://www.example.com/geojson.php?city_id=017');
     // Set mouseover event for each feature.
      map.data.addListener('mouseover', function(event) {
        $('.map-tooltip').text(event.feature.getProperty('name'));
      });
Run Code Online (Sandbox Code Playgroud)

我的 JSON 文件

{
   "type":"FeatureCollection",
   "features":[
      {
         "type":"Feature",
         "geometry":{
            "type":"Point",
            "coordinates":[
               -117.1405,
               33.551667
            ]
         },
         "icon":"http://maps.google.com/mapfiles/dir_0.png",
         "properties":{
            "name":"017001",
            "heading":null,
            "face":"North"
         }
      },
      {
         "type":"Feature",
         "geometry":{
            "type":"Point",
            "coordinates":[
               -117.123269,
               33.552172
            ]
         },
         "icon":"http://maps.google.com/mapfiles/dir_90.png",
         "properties":{
            "name":"050010",
            "heading":null,
            "face":"East"
         }
      },
      {
         "type":"Feature",
         "geometry":{
            "type":"Point",
            "coordinates":[
               -117.122675,
               33.55155
            ]
         },
         "icon":"http://maps.google.com/mapfiles/dir_60.png",
         "properties":{
            "name":"050011",
            "heading":null,
            "face":"South"
         }
      },
      {
         "type":"Feature",
         "geometry":{ …
Run Code Online (Sandbox Code Playgroud)

google-maps-api-3

2
推荐指数
1
解决办法
2532
查看次数

如何在PHP中执行子字符串?

我在PHP中有这个项目,我需要在开始时摆脱"0".

这是我已经拥有的所有字母的代码行,并保留所有数字.

$Number = mysqli_real_escape_string($connect, preg_replace('/[^0-9]/','',$worksheet->getCellByColumnAndRow(2,$row)->getValue()));
Run Code Online (Sandbox Code Playgroud)

输出将是="0123004567"我想用子字符串删除第一个数字"0"(如在java中).你能告诉我如何用PHP做到这一点吗?

php substring

0
推荐指数
1
解决办法
126
查看次数

我想给fa图标HTML上色

假设有一个fa图标:

//这段代码不正确

  <i class="fa fa-trophy fa-3x" aria-hidden="true" style="background-color:#FFFF00;"></i>
Run Code Online (Sandbox Code Playgroud)

我的目的是给奖杯本身上色,而不是奖杯外的背景.现在奖杯看起来像黑色我怎么能改变黄色的奖杯颜色?

html css

0
推荐指数
1
解决办法
167
查看次数

标签 统计

css ×2

html ×2

css-selectors ×1

google-maps-api-3 ×1

php ×1

substring ×1