All Questions
Tagged with css-content css-selectors
12 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 ...
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:...
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 ...
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;
...
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 ...
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 ...
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 ...
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 ...
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: ...
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, ...
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 ...
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 ...