pseudo-element

Two ::after pseudo-elements [duplicate]

这一生的挚爱 提交于 2019-11-29 10:38:22
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: Adding pseudo-elements after pseudo-elements I'd like to apply two css ::after pseudo-elements to a single DOM element, each with a different colour. (Yes, I could wrap the DOM element in another DOM element and give each one and ::after pseudo-element, but my preference is cleaner html.) I doubt it's possible, but wonder if someone can tell me better. I especially doubt the possibility of chaining ::after

Is it possible to user pseudo-element (:after, :before) on table row safely?

狂风中的少年 提交于 2019-11-29 09:45:50
I want to add absolutely positioned element as an :after (of :before ) of a table row. Look at this http://jsbin.com/IGumoye/5/edit I assume that when I add such element rendering engine (at least Webkit based) think it is a table cell of some kind. :before works badly in all browsers. But :after works very well in Firefox and almost good in webkit. In webkit it keep small space and makes whole table width bigger. - This is what bothers me in webkit. How to fix this? And where can I read about why it happening? UPDATE 1 Possible solution: Use first table cell in this row as a host for

CSS: before / after content with title

杀马特。学长 韩版系。学妹 提交于 2019-11-29 09:17:00
I can do div:after { content: "hello" } But can I have the hello text with a title so that when I hover it with the mouse, the title is displayed? Thanks Paulie_D You don't need a pseudo-element for that: p { background:lightblue; padding:15px; margin:15px; } <p class="hover-me" title="I Show up on Hover">Some Text</p> However, if you need to use a pseudo element p { background:lightblue; padding:15px; margin:15px; position: relative; } p:hover:after { position: absolute; content:attr(data-title); left:0; top:0; width:200px; height:1.25rem; background-color: blue; color:white; } <p class=

Why can't I override existing pseudo-elements?

我的未来我决定 提交于 2019-11-29 09:15:04
问题 I have two CSS rules following each other: .some td:first-child:before { content:url('path/to/image.png')" " ; } .some .other:before { content:url('path/to/image2.png')" " ; } Here's the HTML snippet: <table class="some"> <tr> <td class="other">Text goes here</td> <td>Some more text.</td> </tr> </table> They're both supposed to be applied to the same table cell. The one without the class is meant as a fallback. But for some reason, it's always choosing the first rule over the second. I know

Change the :before selector from javascript [duplicate]

蹲街弑〆低调 提交于 2019-11-29 08:43:21
This question already has an answer here: Selecting and manipulating CSS pseudo-elements such as ::before and ::after using jQuery 21 answers How to change the :before content of #abc style from javascript ? <script> document.getElementById('abc').style.content='-'; </script> <style> #abc:before{content:"+";} </style> No, you cannot access :before or :after from javascript, because they are not a part of the DOM. However you can still achieve your goal by using CSS classes: <script> document.getElementById('abc').className = "minus"; </script> <style> #abc:before {content: "+";} #abc.minus

IE8 and IE9 :before and :after elements position absolute are hidden

ⅰ亾dé卋堺 提交于 2019-11-29 06:21:06
I am trying to create a button with "caps" on either end, and a repeating background, in order to keep the button a flexible size. In order to do this, I have used the :before and :after pseudo-elements in CSS, along with position:absolute to get it outside of the main button's background-covered space (using negative values). It works in FF and Chrome, but it looks like in IE8 and 9, the images are there, but are "outside" the button, and therefore are hidden. Does anyone know how to pop these pseudo-elements "out" of the button, so that they will render? I want to keep the HTML to just the

Pseudo-element after not showing? [duplicate]

我是研究僧i 提交于 2019-11-29 06:15:48
问题 This question already has an answer here: Why do the :before and :after pseudo-elements require a 'content' property? 4 answers I want to add a help logo at the end of some form fields which opens a tooltip. Everything is working, but the .helptip icon (http://img1.wsimg.com/shared/img/1/small-help-icon.gif) is coming on the left(merged) with the text. I actually want in on the right of span text, so I did .help-tip:after. But then nothing shows up at all. Can you spot what's wrong? <div

Editing input type=“search” Pseudo-element Button ('x')

流过昼夜 提交于 2019-11-29 06:10:57
问题 I'm trying to make a search bar that will look nice. What I did is, I made an image of an search bar and I'm adding the image to the back-ground of the input and I'm editing the place and the size that the font will appear. The only thing that I can't find a way to edit is the small 'x' button that appears when I'm using input type search. I want to move it a little bit left so it will fix my search bar image. Here is my HTML: <input id="search" name="Search" type="search" value="Search" />

What happens if multiple classes of the same element define a :before pseudo-element? [duplicate]

放肆的年华 提交于 2019-11-29 04:46:27
This question already has an answer here: Can I have multiple :before pseudo-elements for the same element? 2 answers I'm using :before to tag links to user profiles with a symbol to characterise the user, examples include "administrator", "inactive user", "newbie" and so on. The thing is, it's possible for more than one to apply. So what happens if more than one class on the link define a :before pseudo-element with content ? Does the most specific selector override the first? Or do they both appear in order? Whatever happens, is it reliable behaviour? The most specific selector takes

Applying text-decoration on css generated content in IE

本秂侑毒 提交于 2019-11-29 04:28:23
It seems IE doesn't care for text-decoration: none; defined for a:before pseudo element (or pseudo class). Here is a JS Fiddle: http://jsfiddle.net/9N35f/ I'd expect the ">" to lose the underline. It does in FF, Chrome and Safari, but not in IE. Tested with IE10 and IE9. The question: Any workarounds that I could try to make the :before element lose the underline? Ideally in IE9+ Is there a bug report for this somewhere? Or is it actually by the standards? IE seems to be in error here, since display: block in your code should remove the underlining. According to clause 16.3 Decoration in the