pseudo-element

CSS pseudo-element in inline attribute style

放肆的年华 提交于 2019-11-28 10:57:31
问题 I have tried with the sample below from the url. What I trying is to apply css pseudo-element in inline attribute, style. Somehow, it seems not working. I would appreciate for any advice. http://www.w3.org/TR/2001/WD-css-style-attr-20010305 <p style="{color: green; width: 10em} ::first-letter {float: left; font-size: 300%}"> This is an example of a paragraph with inline style attribute rules to create a spot effect, in this case, a drop-cap first letter. </p> 回答1: It’s not possible. The

Has the ::-webkit-selection selector ever been supported?

这一生的挚爱 提交于 2019-11-28 09:58:07
There are a few references on the internet to ::-webkit-selection , a WebKit-specific version of the ::selection selector . See e.g. http://www.quirksmode.org/css/selection.html ( Edit: PPK has since removed ::-webkit-selection from that page.) However, I haven’t been able to get the example in the page above, or my own examples, to work in any WebKit-based browser. I’ve tried: Safari 1.0 1.2 2.0 3.0 4.0 5.0 5.1 Chrome 2 6 14 The unprefixed ::selection selector works in all of these browsers anyway, so it’s not really a problem. But I was wondering where the references to the WebKit-specific

Why the :before and :after pseudo-elements work only in Firefox?

眉间皱痕 提交于 2019-11-28 09:31:56
问题 I've created a select list with options having :after and :before pseudo-elements - DEMO option:after, option::before { content: " "; height: 5px; width: 5px; background: #c00; border-radius: 5px; display: inline-block; } However this works in Firefox only and no other browser. As it stated on W3C, MDN, SitePoint the :after is a " pseudo-element rendered after the matched element and used to add cosmetic content " and nobody states any restriction about elements it can't be applied to.

cursor:pointer on pseudo element IE

心已入冬 提交于 2019-11-28 07:03:17
问题 I am implementing a close button on an element containing text with CSS. The close button is generated content from a pseudo element with content:'X'; . I need the cursor to become a pointer on that "X" so I used : cursor:pointer; It works fine in Chrome and Firefox but it doesn't seem to work in Internet Explorer (testing on IE11 windows 7). DEMO (test in IE) I also tried with cursor:hand; but it doesn't solve the issue. How can I make the cursor a pointer while hovering the "X" but not on

Apply webkit scrollbar style to specified element

↘锁芯ラ 提交于 2019-11-28 05:37:18
I am new to pseudo-elements that are prefixed with a double colon. I came across a blog article discussing styling of scrollbars using some webkit only css. Can the pseudo-element CSS be applied to individual elements? /* This works by applying style to all scroll bars in window */ ::-webkit-scrollbar { width: 12px; } /* This does not apply the scrollbar to anything */ div ::-webkit-scrollbar { width: 12px; } In this fiddle, I would like to make the div's scrollbar customized, but the main window's scrollbar stay at the default. http://jsfiddle.net/mrtsherman/4xMUB/1/ Your idea was correct.

How to remove only underline from a:before?

☆樱花仙子☆ 提交于 2019-11-28 04:26:47
I have a set of styled links using the :before to apply an arrow. It looks good in all browser, but when I apply the underline to the link, I don't want to have underline on the :before part (the arrow). See jsfiddle for example: http://jsfiddle.net/r42e5/1/ Is it possible to remove this? The test-style I sat with #test p a:hover:before does get applied (according to Firebug), but the underline is still there. Any way to avoid this? #test { color: #B2B2B2; } #test p a { color: #B2B2B2; text-decoration: none; } #test p a:hover { text-decoration: underline; } #test p a:before { color: #B2B2B2;

Cannot change the content of visited :before pseudo-elements

不打扰是莪最后的温柔 提交于 2019-11-28 04:05:13
问题 I was trying to add some effects for visited links, then I got this problem. Here is the code: http://dabblet.com/gist/5447894 Only Opera can successfully change the content of :before pseudo-elements. All other browsers are fail. Did I miss anything? Thanks 回答1: The allowed (= not ignored) CSS properties of visited links are color , background-color , border-*-color , outline-color and, column-rule-color (more under certain circumstances). This is to prevent history stealing attacks. See

css: how to remove pseudo elements (after, before, …)

十年热恋 提交于 2019-11-28 03:07:11
I would like to use a switch for the layout of paragraph tags on a webpage. I use the after pseudoelement p:after {content: url("../img/paragraph.gif");} Now i need to remove this css code from the page. How can this be done easily (jquery is already used on the page)? (i do not want to include or remove files containing css) Gillian Lo Wong p:after { content: none; } none is the official value to set the content, if specified, to nothing. http://www.w3schools.com/cssref/pr_gen_content.asp Gabriele Petrioli You need to add a css rule that removes the after content ( through a class ).. An

CSS: before / after content with title

蓝咒 提交于 2019-11-28 02:43:08
问题 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 回答1: 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)

CSS :not(:last-child):after selector

我怕爱的太早我们不能终老 提交于 2019-11-28 02:36:00
I have a list of elements, which are styled like this: ul { list-style-type: none; text-align: center; } li { display: inline; } li:not(:last-child):after { content:' |'; } <ul> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> <li>Five</li> </ul> Outputs One | Two | Three | Four | Five | instead of One | Two | Three | Four | Five Anyone know how to CSS select all but the last element? You can see the definition of the :not() selector here If it's a problem with the not selector, you can set all of them and override the last one li:after { content: ' |'; } li:last-child:after { content: '