:after and :before pseudo-element selectors in Sass [duplicate]

This question already has answers here: Sass .scss: Nesting and multiple classes? (6 answers) Closed 6 years ago. How can I use the :before and :after pseudo-element selectors following the syntax of Sass or, alternatively, SCSS? Like this: p margin: 2em auto > a color: red :before content: “” :after content: “* * *” Of … Read more

Is there a CSS selector by class prefix?

I want to apply a CSS rule to any element whose one of the classes matches specified prefix. E.g. I want a rule that will apply to div that has class that starts with status- (A and C, but not B in following snippet): <div id=’A’ class=”foo-class status-important bar-class”></div> <div id=’B’ class=”foo-class bar-class”></div> <div id=’C’ … Read more

Using :before and :after CSS selector to insert HTML [duplicate]

This question already has answers here: Can you add line breaks to the :after pseudo element? (4 answers) Closed 3 years ago. I’m wondering if the following is possible. I know it doesn’t work, but maybe I’m not writing it in the correct syntax. li.first div.se_bizImg:before{ content: “<h1>6 Businesses Found <span class=”headingDetail”>(view all)</span></h1>”; } Any … Read more

How can I select the last element with a specific class, not last child inside of parent?

<div class=”commentList”> <article class=”comment ” id=”com21″></article> <article class=”comment ” id=”com20″></article> <article class=”comment ” id=”com19″></article> <div class=”something”> hello </div> </div> I want to select #com19 ? .comment { width:470px; border-bottom:1px dotted #f0f0f0; margin-bottom:10px; } .comment:last-child { border-bottom:none; margin-bottom:0; } That does not work as long as I do have another div.something as actual last child in … Read more

Angular 2: How to style host element of the component?

I have component in Angular 2 called my-comp: <my-comp></my-comp> How does one style the host element of this component in Angular 2? In Polymer, You would use “:host” selector. I tried it in Angular 2. But it doesn’t work. :host { display: block; width: 100%; height: 100%; } I also tried using the component as … Read more

What is syntax for selector in CSS for next element?

If I have a header tag <h1 class=”hc-reform”>title</h1> h1.hc-reform{ float:left; font-size:30px; color:#0e73bb; font-weight:bold; margin:10px 0px; } and after that I have a paragraph <p>stuff here</p>. How can I ensure using CSS that every <p> tag that follows the h1.hc-reform to use: clear:both; would that be: h1.hc-reform > p{ clear:both; } for some reason that’s not … Read more