pseudo-element

CSS how to vertically align text within a pseudo element

左心房为你撑大大i 提交于 2019-12-05 20:00:22
I have created a pseudo element to sit over an unordered list, the css is as follows: .pricing-column.featured::after { content: "Most Popular"; background: #52BDE6 none repeat scroll 0% 0%; color: #FFF; width: 80px; border-radius: 100%; position: absolute; top: -10px; left: -10px; z-index: 1000; text-transform: uppercase; font-weight: 700; font-size: 0.9em; line-height: 0.9em; padding: 10px; display: inline-block; height: 80px; } However, with this, the text inside the pseudo element sits at the top of my element - is there a way to center it vertically? Here is a fiddle http://jsfiddle.net

Is :hover:after supported in IE8?

心已入冬 提交于 2019-12-05 19:46:28
I have a flyout menu where at the end of "Quick Links" I use the :after pseudo-element on the first LI tag to display an icon from a sprite file. The HTML: <ul class="rs-quick-links-nav"> <li> <a href="#">QUICK LINKS</a> <ul> <li><a href="#">Enhanced Recipe Search</a></li> <li><a href="#">Recipe Collections & Favorites</a></li> <li><a href="#">Cooking Tips & Techniques</a></li> <li><a href="#">Shopping & Storing</a></li> <li><a href="#">Tools & Products</a></li> <li><a href="#">New Uses for Old Things</a></li> <li><a href="#">Guide to Ingredients</a></li> </ul> </li> </ul> The CSS: .rs-quick

On hovering one pseudo element, make the other pseudo element appear?

一个人想着一个人 提交于 2019-12-05 17:53:25
问题 I was trying to generate a screen in which utilises the :before and :after pseudo elements, but I'm wondering if such functionality is actually possible. I have a wrapper div which is wrapped around an input (allowing for pseudo element s on this wrapper). something like: +-----------------------------------+ | +-------------------------------+ | | | | | <-- wrapper div | +-------------------------------+ <-- input element +-----------------------------------+ However, I was looking to have a

Same specificity, after taking placement into consideration, :first-letter always wins?

≡放荡痞女 提交于 2019-12-05 17:36:48
问题 Take a look at this jsfiddle: http://jsfiddle.net/ZNddz/ .intro:first-letter { font-size: 130px; } span.letter { background-color: red; font-size: 30px; } p { font-size: 80px; } The first rule consist of one class selector and one pseudo-element selector = 11 The second rule consist of one class selector .letter and one tag selector span = 11 Both rules have same specificity so it is reasonably to believe that the winner should be the last style. Obviously it is not the case. So I decided to

Unexpected duplication of :after pseudo element assigned to SVG:text. Working with pseudo elements and SVG

五迷三道 提交于 2019-12-05 12:24:23
This is a two-part question, see below. While trying to add a % symbol via CSS to an instance of SVG text using the :after pseudo-element I ran into this problem ( JsFiddle provided). I am on Chrome Version 24.0.1312.57. HTML: <span class="percentage2">This is 20</span> <p class="percentage2">This is 20</p> <h1 class="percentage2">This is 20</h1> <div class="wrapper"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1"> <text x="20" y="20" style="fill:black;" class="percentage2">This is 20</text> </svg> </div> CSS: .wrapper { width: 300px; height:80px; overflow:hidden; } .percentage2:after {

Difference between Scrapy selectors “a::text” and “a ::text”

为君一笑 提交于 2019-12-05 12:05:06
I've created a scraper to grab some product names from a webpage. It is working smoothly. I've used CSS selectors to do the job. However, the only thing I can't understand is the difference between the selectors a::text and a ::text (don't overlook the space between a and ::text in the latter). When I run my script, I get the same exact result no matter which selector I choose. import requests from scrapy import Selector res = requests.get("https://www.kipling.com/uk-en/sale/type/all-sale/?limit=all#") sel = Selector(res) for item in sel.css(".product-list-product-wrapper"): title = item.css("

What is the element type of pseudo-elements?

懵懂的女人 提交于 2019-12-05 10:52:46
<pseudo> </pseudo> ? The pseudo-elements of CSS are not in the DOM. But internally they must be equivalent to some kind of generic HTML element, since they can be styled, can be visible, and they affect the page flow. What is the element type of a pseudo element? And can we programmatically create them, without using CSS? Pseudo-elements have no element type as far as the document language is concerned because, as you state, they don't exist in the DOM, and as can be inferred from the "pseudo-" prefix, they're not "real" elements. CSS just calls them pseudo-elements, however you have different

Is it somehow possible to style an iframes before/after pseudo-element?

百般思念 提交于 2019-12-05 10:46:27
问题 As the title says, is there a way to style an iframes pseudo before / after ? Without wrapping the iframe with another div , or else?` I tried to style it like any other element, but no success: iframe::before { content: 'foo'; position: absolute; top: 0; left: 0; } iframe::after { content: 'bar'; position: absolute; top: 0; right: 0; } http://fiddle.jshell.net/ppRqm/ Update A known workaround is to add the before/after to an element in the source file: http://fiddle.jshell.net/ppRqm/2/ But

What is a pseudo element?

冷暖自知 提交于 2019-12-05 09:08:00
I'm dissecting this very beautiful example of how CSS can help you create nice glow effects on images. http://jsfiddle.net/necolas/KbNq7/ This particular line from the example mentions: Although this method will only produce the full effect in Firefox 4, other browsers will eventually catch up and apply transitions to pseudo-elements . What is a pseudo-element? Jason Gennaro Pseudo-elements are CSS selectors that manipulate parts of an element in a special way. They include: :first-line :before :after Application Pseudo elements are applied like so p:first-letter{ color:black; font-style

IE10: 'visibility:visible' on before pseudo-element of 'visibility:hidden' element

岁酱吖の 提交于 2019-12-05 03:01:55
I have made a DIV with visibility: hidden and attached a ::before pseudo-element of this DIV with visibility: visible . This works as expected in Firefox, Chrome and Safari, but in Internet Explorer 10 the pseudo-element does not render. Please explain if I'm accomplishing this wrong, or whether this is an issue with Internet Explorer. Are there any work arounds (we only have access to the CSS, not the source HTML)? JSFiddle demonstrating issue . Filters don't work on pseudo elements in IE. Read: msdn Other specified styling properties apply to the appearance of the inserted content, not to