Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/445.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/3/html/71.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
Javascript 如何在离子列表、离子项中使用CSS_Javascript_Html_Css_Ionic Framework - Fatal编程技术网

Javascript 如何在离子列表、离子项中使用CSS

Javascript 如何在离子列表、离子项中使用CSS,javascript,html,css,ionic-framework,Javascript,Html,Css,Ionic Framework,我正在开发一个应用程序,我正在从JSON获取数据,它运行良好,但我的问题是我不知道如何使用指令使用CSS样式。下面我展示了代码。第二个代码是css工作的代码 <!-- With Json </!--> <ion-list> <ion-item> <a class="item item-avatar" ng-repeat="x in names|orderBy:'Name'" href="#">

我正在开发一个应用程序,我正在从JSON获取数据,它运行良好,但我的问题是我不知道如何使用指令使用CSS样式。下面我展示了代码。第二个代码是css工作的代码

<!-- With Json </!-->

<ion-list>  
    <ion-item>

       <a class="item item-avatar" ng-repeat="x in names|orderBy:'Name'"  href="#">
          <img ng-src="{{x.Image}}">
          <h2>{{x.Name}}</h2>
          <p>  {{x.Local}}</p>
        </a>

    </ion-item>
</ion-list> 


<!-- example static, without json, css works good  </!--> 
<div class="list" id="inicioPalestrantes" >
   <a class="item item-avatar" id="palestrantes" href="#">
     <img src="Fiona.jpg">
     <h2>Fiona Doohan</h2>
     <p> UDC, Dublin, Ireland </p>
   </a>
</div>

对于CSS规则,您需要id选择器
最好使用
,而不是
id

.list .item {
  background-color: #F0F8FF;
  border-width: 1px;
  border-style: ridge;
  border-color: #C0C0C0;
}

.list {
  margin-top:0%;
}

在后一个示例中,您在属性上提供了一个ID,但在第一个示例中没有。。。你能提供css吗?是的,我试过使用id,但它不起作用。请发布你的css,没有它我们帮不上忙it@Sobucki我明白了,这不管用吗。。或者你删除的答案是一个有效的自我回答,但你只是无法将其发布正确?不,我的css中有“#”,但当我在@Sobucki中使用时,好的,列表中有不止一项吗。。都有相同的id吗?是的,在JSON中有更多的iTen,也有相同的idid@Sobucki多次使用同一id无效。我用
#inicioPalestrantes a{…}
更新了我的答案。这样行吗?