All Questions
Tagged with css-content pseudo-element
83 questions
0
votes
1
answer
732
views
How do I override the CSS content property of a pseudo ::before/::after element?
This question is not a duplicate, though it might appear so to someone not reading very carefully.
This is not a question about CSS specificity, nor is it about the !important directive (I don't think)...
0
votes
1
answer
278
views
Using regular expression in CSS pseudo element
Not sure this is possible with CSS only, can the content of a pseudo selector contain a regular expression?
In this scenario:
.normal-class::before {
/*content: attr(class); => this works, ...
1
vote
2
answers
111
views
Is the height of a picture that is inserted by ::before or ::after controllable? [duplicate]
I used ::before or ::after to insert a picture. The code in CSS is like this:
p::before {
content: url(../image/xs.jpg);
}
or
p::after {
content: url(../image/submit.png);
}
When I inspect ...
0
votes
1
answer
311
views
Using css pseudo element in php doesn´t work
My issue is that I had to add in php the tag in order to put there some styles with pseudo element span: before and a content: 'text' in which I have a translation for serveral languages.
Of course, ...
1
vote
1
answer
2k
views
Google Chrome Dev Tools remove element's :after from DOM when :after display is none
My problem is about Google Chrome Dev Tools when I want to set display: none; to an after in DOM for a moment but Chrome remove all afters elements from DOM and I can't access to them again.
My Chrome ...
89
votes
2
answers
5k
views
Why are double quotes shown only for the first element?
I am wondering why the browser shows double open quotes only for the first element. The second element has single quotes instead.
a::before {
content: open-quote;
}
<a href="http://www....
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:...
2
votes
1
answer
637
views
Children :before content inheritance
The title might be a little bit confusing but I wonder why is it impossible for a child element to inherit it's parent ::before content. for example:
HTML:
<div class="foo">
<div class="...
3
votes
1
answer
1k
views
How could a web spider crawl the content in ::before?
The content in a pseudo element such as ::before or ::after actually not exists in the DOM tree. So, It's impossible to locate it by selector.
The question is, how could I extract the content in it? ...
0
votes
1
answer
484
views
Making content appear below the :before pseudo selector?
I have an element
<div class="Test_then">The result is ...</div>
The Test_then class looks like this:
.Test_then::before {
content: 'Then';
}
My goal is to have the (The result is ...) ...
10
votes
4
answers
15k
views
Div with CSS content, after pseudo element is not visible
I have a POC that I have to complete and I am only allowed to use CSS to update the styles of a product. I have replaced one of the images of the product with a logo by using the CSS content ...
0
votes
2
answers
99
views
Semantic way of stacking two characters in a ::before element?
I'm trying to add checklist symbols to the left edge of table cells. So far, this does work. When I'm trying to stack another char on top of the checklist symbol though, things get ugly.
I have found ...
0
votes
2
answers
961
views
Changing content of the <title> element with pseudo-element
What i want
To change contents of html 'title' element by selecting it via '::before' pseudo-element and applying 'content' attribute to selection.
Problem
I have a webpage:
<html>
<head>
...
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 ...
4
votes
1
answer
308
views
Find a text generated by "content" CSS property [duplicate]
https://jsfiddle.net/2gf6gq0s/
I use ::after pseudo-element to insert text in my document:
<div class="foo"></div>
<div>test</div>
<style>
.foo::after { content: "...