Custom Style for Child elements
See original GitHub issueHi gmerabishvili,
I love angular-ng-autocomplete. Thanks for make it.
Is it possible to enable custom style for elements like “input”?.
I have been added custom css like:
.ng-autocomplete { width: 100%; }
And this is ok.
But when I tried to add this nothing happened:
.ng-autocomplete .autocomplete-container { box-shadow: none !important; }
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Apply CSS Style to child elements - Stack Overflow
Show activity on this post. I want to apply styles only to the table inside the DIV with a particular class: Note: I'd...
Read more >Child combinator - CSS: Cascading Style Sheets | MDN
The child combinator ( > ) is placed between two CSS selectors. It matches only those elements matched by the second selector that...
Read more >How to apply style to parent if it has child with CSS?
How to apply style to parent if it has child with CSS?
Read more >How to apply style to parent if it has a child with CSS
It's easy to apply style to a child element, but if you want to apply style to a parent class that already has...
Read more >CSS Apply to All Children - Linux Hint
We have a child selector in CSS to selecet and apply style to all the children. The child selector is also known as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @enriqueavg , Thank you very much! Yes it is possible. You just need to use ::ng-deep. Here is the example:
Hi,
something.component.css looks like this:
`.ng-autocomplete { width: 100%; }
.ng-autocomplete ::ng-deep .autocomplete-container { box-shadow: none; }
.ng-autocomplete ::ng-deep .autocomplete-container ::ng-deep .input-container ::ng-deep input { font-size: 0.875rem; display: block; height: 2.1875rem; padding: 0.375rem 1rem; font-weight: 400; line-height: 1.52857143; color: #495057; border: 1px solid #dde6e9; border-radius: 0.25rem; }
.ng-autocomplete ::ng-deep .autocomplete-container ::ng-deep .suggestions-container ::ng-deep .item ::ng-deep .row { padding: 0.5rem 1rem; }
.ng-autocomplete ::ng-deep .autocomplete-container ::ng-deep .not-found { border: 0; }`
And something.component.html:
` <div class="ng-autocomplete">
`