pseudo-element

How to create a box with a left arrow and border

折月煮酒 提交于 2019-12-01 09:24:03
问题 I'm trying to create a box with a left arrow/triangle which has a opaque border surrounding it. I'm using CSS3 in order to avoid using images. The box will contain dynamic content so the height will likely vary. In the image attached you can see my progress on the left and what I am trying to achieve on the right. Here is a JSFiddle of what I have so far. As you can see there are 2 problems: 1) Due to the opacity you can see the border surrounding the triangle overlaps the border surrounding

html special characters in css content, using attr()

我们两清 提交于 2019-12-01 09:17:38
Relevant codepen: http://codepen.io/anon/pen/ocptF/ EDIT: The codepen uses Jade, and thus messes a few things up. I was not aware of this when starting this question. Essentially, I thought CSS attr() would copy over an HTML attribute literally, but that is not the case. I'd like to use the CSS attr function to fill in the content for some pseudoelements. However, it prints out 004 when the HTML attribute is set to \f004 , and 08fa when \f08fa . Relevant lines: HTML: <div class="zoomfade" data-fill='\f004' data-unfill='\f08a'></div> CSS: .zoomfade:before { content: attr(data-unfill); position:

::first-letter pseudo-element not working in firefox

◇◆丶佛笑我妖孽 提交于 2019-12-01 08:42:30
问题 I cannot for the life of me figure this one out. I just want to style the dollar sign to be a different color and I would like to avoid using another element around the dollar sign. <ul> <li><strong>John Dow</strong> <div>$5,849,487<sup>84</sup></div></li> <li><strong>David Jones</strong> <div>$5,498,364<sup>01</sup></div></li> <li><strong>Susie Smith</strong> <div>$5,098,276<sup>35</sup></div></li> </ul> And this CSS: li::first-letter { color: blue; } li div::first-letter { color: red; }​​

html special characters in css content, using attr()

梦想与她 提交于 2019-12-01 06:03:51
问题 Relevant codepen: http://codepen.io/anon/pen/ocptF/ EDIT: The codepen uses Jade, and thus messes a few things up. I was not aware of this when starting this question. Essentially, I thought CSS attr() would copy over an HTML attribute literally, but that is not the case. I'd like to use the CSS attr function to fill in the content for some pseudoelements. However, it prints out 004 when the HTML attribute is set to \f004 , and 08fa when \f08fa . Relevant lines: HTML: <div class="zoomfade"

Cannot view the source image file on a website

风流意气都作罢 提交于 2019-12-01 05:47:36
http://www.wordherd.co/#features On this site, when I try to look at the source image file of any of the icons (like "Directions") using Firebug, it displays some sort of unicode for the content. How do you get to the source image files? I'm trying to understand the hack they are using to prevent the images from being accessible. Josh Crozier These "images" are icons fonts. They are usually added via :before / :after pseudo elements. In this instance, the content value is an ASCII representation of an external font library character. .icon-flag:before { content: "\f024"; } In order for this to

Anyone know why this :after CSS isn't working in IE9?

房东的猫 提交于 2019-12-01 04:20:46
This submit button should be rounded on the left side, and pointed on the right side. It's working in non-ie browsers, but in IE9, it is not working. If I look at the styles in the developer tools, the .flat-button:after rule has everything crossed out, as if it is superseded by something. What? <button type="submit" class="flat-button">Submit</button> <style> .flat-button { float: left; position: relative; border-top-left-radius: 5px; -moz-border-top-left-radius: 5px; -webkit-border-top-left-radius: 5px; border-bottom-left-radius: 5px; -moz-border-bottom-left-radius: 5px; -webkit-border

:before and :after pseudo elements on html tag is wonky in Chrome

点点圈 提交于 2019-12-01 04:14:05
I'm trying to learn how to use the :before and :after pseudo elements. I'm trying to add a black background to the bottom of the page as a sticky footer but it doesn't seem to be working correctly. Basically I have a repeating image as the background of the HTML element and then I add an absolute div positioned at the bottom with a solid black background. I'd just like to point out that this is a learning experiment and not really how I'd achieve the same effect but what I'm trying is working in Firefox but not in Chrome! Here's my CSS: html { background-image: url('images/template/html-bg.jpg

WebDriver select element that has ::before

天大地大妈咪最大 提交于 2019-12-01 04:04:55
I have 2 elements that have the same attributes but shown one at a time on the page (When one is shown, the other disappears).The only difference between the two is that the element which is displayed will have the '::before' selector. Is it possible to use an xpath or css selector to retrieve the element based on its id and whether or not it has ::before I bet also to try with the javascript solution above. Since ::after & ::before are a pseudo element which allows you to insert content onto a page from CSS (without it needing to be in the HTML). While the end result is not actually in the

Pseudo-element background image doesn't appear

我与影子孤独终老i 提交于 2019-12-01 02:57:20
I have a div element with a triangle-border and I'm trying to place an image above it using an ::after pseudo-element with background-image . The method doesn't work though. However if I'm trying to set content: "asd"; , the text appears correctly. Basically I just want to have a house image above that triangle. Here's the HTML code: <div id = "estatecorner" class = "house"></div> And here's the CSS: #estatecorner { position: absolute; right: 0px; width: 0; height: 0; border-style: solid; border-width: 0 80px 80px 0; border-color: transparent #67b2e4 transparent transparent; } #estatecorner

Cannot view the source image file on a website

老子叫甜甜 提交于 2019-12-01 02:52:57
问题 http://www.wordherd.co/#features On this site, when I try to look at the source image file of any of the icons (like "Directions") using Firebug, it displays some sort of unicode for the content. How do you get to the source image files? I'm trying to understand the hack they are using to prevent the images from being accessible. 回答1: These "images" are icons fonts. They are usually added via :before / :after pseudo elements. In this instance, the content value is an ASCII representation of