Skip to main content

All Questions

2 votes
2 answers
768 views

How to style the last char from input text in CSS?

I have the following snippet which styles one input text element as follows: Every written char will be placed into a special square box. The problem is that appeared a strange behaviour when I wrote ...
user9549074's user avatar
1 vote
3 answers
103 views

Different content for each "::before" pseudo-element

How can we give different content to each ::before pseudo-element? My code looks like this: .timeline h1::before { position: absolute; font-size: inherit; left: 0; } .timeline h1:...
Shabrina Fitri's user avatar
0 votes
1 answer
2k views

CSS selector and content property to add a space character between two inline-block elements

I have a series of span elements of class tag (from bootstrap v4) which are adjacent to each other without any space between them because they come from a reacj.js array of JSX elements : <span ...
beeb's user avatar
  • 1,217
3 votes
1 answer
6k views

css3 "::after" pseudo-element not working

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; ...
The Odd Developer's user avatar
21 votes
1 answer
19k views

add css content text in 'empty' divs

See this fiddle: http://jsfiddle.net/xanld/3yh28/ div:before { content: 'This div is empty'; } div:empty { background:red; } I'd like to add css content to empty divs only. I can either use ...
xanld's user avatar
  • 1,077
3 votes
2 answers
677 views

How does the browser render pseudo element selectors?

What I'm particularly wondering is how expensive *:after would be, resource-wise. Would the pseudo element become the key selector in this case? Or would the client grab all the elements anyway? In ...
user avatar
0 votes
1 answer
685 views

When using :before on an element it becomes the first child of said element?

I've always used :before in CSS to mean put content before the selector. I've never had any problems with this, however, I've stumbled across something that is confusing me where a selector's :before ...
o_O's user avatar
  • 5,743
7 votes
3 answers
220 views

using both :after and :hover

Is it possible to only display the :after pseudo using :hover? For example using alternative elements. #parent{} #child{display:none;} #parent:hover >#child{display:block;} As far as I've got with ...
bashleigh's user avatar
  • 9,354
175 votes
5 answers
205k views

Can I have multiple :before pseudo-elements for the same element?

Is it possible to have multiple :before pseudos for the same element? .circle:before { content: "\25CF"; font-size: 19px; } .now:before{ content: "Now"; font-size: 19px; color: ...
ChrisOdney's user avatar
  • 6,434
2 votes
2 answers
148 views

Why is `content:""` negating selectors below it?

I am having a very odd problem. So I have a huge pile of CSS, and among many selectors within it, I have selector that looks like this, which is working just fine: .spoilertop, #QUOTETOP, #CODETOP, ...
deathlock's user avatar
  • 2,847
2 votes
4 answers
9k views

Can CSS Content Property work in IE7?

I came across with CSS content property, which it is able to add text into element. for example: .class:after{ content: "testing"; } Unfortunately this CSS property only working in IE8 only with ...
sams5817's user avatar
  • 1,037
62 votes
3 answers
60k views

CSS:after encoding characters in content

I am using the following CSS, which seems to be working: a.up:after{content: " ↓";} a.down:after{content: " ↑";} The characters however cannot seem to be encoded like this, as the output is ...
theorise's user avatar
  • 7,465