pseudo-element

after pseudo element not appearing in code [duplicate]

自古美人都是妖i 提交于 2019-11-27 15:29:44
This question already has an answer here: Why do the :before and :after pseudo-elements require a 'content' property? 4 answers I'm trying to use the after pseudo element to add some effects to a site. <div class="product-show style-show"> <ul> <li> .... <div class="..."> <div class="readMore less">...</div> <a href="3" class="readMoreLink" onclick="return false;">Read More</a> </div> .... </li> </ul> </div> And stylesheets: .product-show .readMore.less { max-height: 200px; height: 100%; overflow: hidden; } .product-show .readMore.less:after { background: rgba(255, 255, 255, 0); display: block

How to prefix a word in a list number

巧了我就是萌 提交于 2019-11-27 15:22:14
问题 So I've searched high and low and have been unable to find an answer for a seemingly simple problem. I have an ordered list like this: <ol> <li>Some text here</li> <li>Some more text here..</li> <li>Oh yeah, here's some pretty text</li> </ol> Which displays: Some text here Some more text here.. Oh yeah, here's some pretty text What I'd like to really display: Step 1. Some text here Step 2. Some more text here.. Step 3. Oh yeah, here's some pretty text Question: Is this possible, and if so,

How can I get IE8 to accept a CSS :before tag?

﹥>﹥吖頭↗ 提交于 2019-11-27 14:56:48
问题 I have the following CSS code .editable:before { content: url(../images/icons/icon1.png); padding-right:5px; } this is used in conjunction with the following markup: <span class="editable"></span> In every other blessed browser in the world my icon is appearing, but IE8 seems to have a problem with this. Isn't the :before pseudo-element CSS2? isn't content: also a CSS2 command? what gives? 回答1: Update: I misread the page! IE 8 does support :before with images, it just doesn't when it is in

CSS double border (2 colors) without using outline?

狂风中的少年 提交于 2019-11-27 14:42:38
I was wondering what you guys think is the easiest way to get a double border with 2 colors around a div? I tried using border and outline together and it worked in Firefox, but outline doesn't seem to work in IE and that's sort of a problem. Any good ways to go about this? This is what I had but outline does not work with IE: outline: 2px solid #36F; border: 2px solid #390; Thanks. You can add multiple borders using pseudo elements, and then place them around your original border. No extra markup. Cross-browser compatible, this has been around since CSS 2.1. I threw a demo up on jsfiddle for

Use javascript to click on a pseudo-element?

余生颓废 提交于 2019-11-27 14:40:54
I'm wondering how to enable the clicking on a :before pseudo-element (the orange part of the div on the JSfiddle I link to below). I've read that since pseudo-elements aren't in the DOM you would need a hack for this. Unfortunately, I can't find an existing Stackoverflow Q&A that actually shows working code. Link: http://jsfiddle.net/Vv6Eb/4/ HTML: <div></div> CSS: div { position:relative; background-color:#333; padding:20px; margin:20px; float:left; } div:before { content:""; display:block; padding:5px; background-color:#f60; border:2px solid white; position: absolute; top:-2px; right:-2px;

Attach font icon to last word in text string and prevent from wrapping

本秂侑毒 提交于 2019-11-27 13:54:40
问题 I want to attach a Font Awesome icon to the last word in a text string: foo bar● But if a line wrap is required, I want the icon to attach to the last word and have them wrap together: foo bar● My problem is very similar to: Prevent :after element from wrapping to next line However, the solution assumes I have access to the last word. In my case, the text will be generated dynamically. Is there a css/html-only way to ensure the icon wraps with the last word? Here's a jsfiddle. 回答1:

Can a ::before selector be used with a <textarea>?

可紊 提交于 2019-11-27 13:52:04
I'm experimenting with some styles on <textarea> s and I tried doing some stuff with ::before and ::after selectors and I couldn't to anything to get them to work. So the question is: is this possible? I know the CSS surrounding forms is arcane beyond mention but it seems like this should work. The :before and :after will not work on a text-area (nor any element that cannot contain another element, such as img or input ), because the generated content of the pseudo-element gets placed within the element but before or after that element's content, and acts itself as an element. The pseudo

Change style of pseudo elements in angular2

 ̄綄美尐妖づ 提交于 2019-11-27 13:37:29
Is it possible to change style of pseudo elements using [style] or [ngStyle] in angular2? in order to get a blur effect on a div acts like an overlay, and I should set up background-image on pseudo element. I tried something like <div class="blur" [style.before.backgroundImage]="'url('+ featuredImage[i] + ' )'"> it didn't work. I also tried this <div class="blur" [ngStyle]="'{:before{ background-image:url('+ featuredImage[i] + ' )}}'"> dfsq No it's not possible. It is actually not an Angular issue: pseudo elements are not part of DOM tree, and because of that do not expose any DOM API that can

CSS Pseudo Element Counters: can you increment an alphabet letter “a”, “b”, “c”, etc instead of a number?

馋奶兔 提交于 2019-11-27 13:08:30
As defined here: http://www.w3.org/TR/CSS21/generate.html#propdef-counter-increment You can use code like the following to increment numbers in pseudo elements. H1:before { content: "Chapter " counter(chapter) ". "; counter-increment: chapter; /* Add 1 to chapter */ } H1 { counter-reset: section; /* Set section to 0 */ } H2:before { content: counter(chapter) "." counter(section) " "; counter-increment: section; } Is there a way you can use the same code to increment letters like "a", "b", "c", etc? Thank you! Yes, the second argument to counter() defines the type of counter used, as for the

:hover:before text-decoration none has no effects?

谁都会走 提交于 2019-11-27 12:03:19
问题 As title, I'm adding icons using .icon-* . When adding an icon to an hyperlink: <a href="#" class="icon-email icon-large">Email me!</a> The content inserted by content property shows the underline text-decoration on hover. I'd like to disable the text-decoration only for the content before: [class^="icon-"]:before, [class*=" icon-"]:before { font-family: 'IcoMoon'; font-style: normal; speak: none; } .icon-mail:before { content: "\37"; } [class^="icon-large-"]:before, [class*=" icon-large"]