簡體   English   中英

CSS樣式不在angularjs文本字段中顯示

[英]CSS styles not displaying in angularjs text field

我在下面有這個代碼,我想用CSS設置樣式,但我的樣式表只影響標題,而不是單擊框中的文本。 如何使CSS樣式表在文本上有效? 或者我如何定位該文本來設置它?

 function MyCtrl($scope) { $scope.environment_service_packages = [ {name: 'Styles displayed here', info: {text: 'Styles not displayed here', show: true}}, {name: 'obj2', info: {text: 'some extra info for obj2', show: false}}, {name: 'obj3', info: {text: 'some extra info for obj3', show: false}}, {name: 'obj4', info: {text: 'some extra info for obj4', show: false}}, ]; } 
 <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <body ng-app> <table ng-controller="MyCtrl" class="table table-hover table-striped"> <tr class="info"> <td>...</td> </tr> <tbody ng-repeat="x in environment_service_packages"> <tr ng-click="x.info.show = !x.info.show"> <td> {{ x.name }} </tr> <tr ng-show="x.info.show"> <td> <pre>{{ x.info.text }}</pre> </td> </tr> </tbody> </table> </body> 

我意識到我在一個頁面中使用了兩個相互沖突的樣式表,因此刪除一個可以解決問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM