css-content

Color “transparent” not working

那年仲夏 提交于 2019-12-02 20:39:51
I have a problem with the IE (what else?): I generate content with CSS which has also a background-image. I looks like that: #nav ul li:after { content: "--"; position: relative; z-index: 99; background: transparent url(image.png); color: transparent; } The text color is in non-IE-browsers transparent, but in all IE browsers (IE6-IE8) it's black and you could see it. How could I make the text transparent/unvisible? I tried already: visibility - opacity - filter - text-indent ... But none did his job right, either it disappears (with it background which I need) or the attribute doesn't apply.

css3 “::after” pseudo-element not working

我们两清 提交于 2019-12-02 06:40:15
问题 I want to add a triangle after a div tag.Therefore i used css3 after pseudo-element. But it's not working. Following is my css rule. .header-wrapper .part1 ::after { width: 0; height: 0; border-left: solid 48.35px #f21e1e; border-bottom: solid 48.35px transparent; border-top: solid 48.35px transparent; } Following is my html part <div class="header-wrapper"> <div class="part1"></div> </div> 回答1: In order for the pseudo element to be generated, you need to specify a content value. The value is

css3 “::after” pseudo-element not working

淺唱寂寞╮ 提交于 2019-12-02 01:32:06
I want to add a triangle after a div tag.Therefore i used css3 after pseudo-element. But it's not working. Following is my css rule. .header-wrapper .part1 ::after { width: 0; height: 0; border-left: solid 48.35px #f21e1e; border-bottom: solid 48.35px transparent; border-top: solid 48.35px transparent; } Following is my html part <div class="header-wrapper"> <div class="part1"></div> </div> In order for the pseudo element to be generated, you need to specify a content value . The value is otherwise assumed to be the default, none - which is likely why it isn't working in your case. (example)

What does an empty value for the CSS property content do?

倖福魔咒の 提交于 2019-12-01 19:25:31
nav ul:after { content:""; clear:both; display:block; } What does the "" value mean on the content property? Mr. Alien It's just a clearfix, which means, if your ul elements have floated li , than they will be self cleared, it just behaves similar to overflow: hidden; but unlike overflow: hidden; it wont hide the overflowing content. Demo (Without clearfix) Demo 2 (With clearfix) And why you need to clear and what you need to clear, for that, you can refer my answer here As you edited your question, content property is used with :before or :after pseudo to embed virtual content on the page, so

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:

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"

Using attr(data-icon) property to display unicode before element

流过昼夜 提交于 2019-11-30 17:38:32
Lets demonstrate an example with simple HTML code like this: <div data-icon="\25B6">Title</div> I would like this element to have an prefix icon set by it's data attribute (data-icon) so I set CSS file like this: div:before { content: attr(data-icon); } My desired output of this example would look like this: ▶Title Instead of desired output all I can get is this: \25B6Title So my question is: what am I doing wrong / what am I missing? JSFiddle example: http://jsfiddle.net/Lqgr9zv6/ BoltClock CSS escape sequences only work within CSS strings. When you take a CSS escape sequence from an HTML

How did CSS `content` property work for `img` element in WebKit?

我怕爱的太早我们不能终老 提交于 2019-11-30 11:25:05
Long time ago there was a draft of CSS3 Generated Content spec which allowed the content property for any HTML element (not only ::before/::after pseudo-elements), without any formal restriction for empty or replaced elements. It was once supported by Opera Presto ( 1 , 2 ) and, at least to some extent, by WebKit ( 3 ). By the end of 2011, WebKit's implementation of content for img element seemed to effectively convert it from an empty replaced element to non-replaced element like span (even its context menu changed, removing options like 'Save image as...'). It also made it possible to apply

CSS: how to add white space before element's content?

十年热恋 提交于 2019-11-30 10:18:18
问题 None of the following code works : p:before { content: " "; } p:before { content: " "; } How do I add white space before element's content ? Note: I need to color the border-left and the margin-left for semantic use and use the space as colorless margin. :) 回答1: You can use the unicode of a non breaking space : p:before { content: "\00a0 "; } See JSfiddle demo [style improved by @Jason Sperske] 回答2: Don't fart around with inserting spaces. For one, older versions of IE won't know what you're

Input placeholder using CSS only

拜拜、爱过 提交于 2019-11-30 10:01:18
I know there are lot's of questions regarding this query here but none of them provide the solution for me. HTML <input id="tb1" type="text" class="note" /> <br> <p class="note1"> This is not done.</p> CSS p.note1:before{ content: "Note:"; } tb1.note:before{ content: "Enter your number"; } I am trying with above code and the variation as found on the web but none seems to work for input tag. It's working for p tag. EDIT: I can't add value attribute to input tag and manage css for the desired result. It's the limitation of the system. EDIT2: Forget about my css, is there any way that