Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to take out text in a div, and replace it.
h2{content:none;}
h2:after{content:'CONTENT';}
I tried using text-indent, display:none, etc. Nothing is working. And no, I don't want to replace it with a picture. Please help, thanks.
You can try something like this:
HTML
<div id="bla">Hello world</div>
CSS
#bla:before {
content: "Goodbye planet";
position:absolute;
background-color:white;
}
Demo: http://jsfiddle.net/FHnks/1/
Note that content added via CSS is not a part of the DOM and will not be accessible via scripts.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I am saw in the documentation the mozilla y i wonder how workings the attribute: attr().
this is the docs that I seem : mozilla
OK I understand this code:
p::before {
content: attr(data-foo) " ";
}
<p data-foo="hello">world</p>
but my question is where could use attr() in css and what is diffrent between attr() from css and attr from javascript.
attr() used to manipulate attribute values.
In your code
<p data-foo="hello">world</p>
data-foo is an attribute
so
content: attr(data-foo) " ";
here attr(data-foo) is the value ie hello
so the output is hello world
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Was getting into CSS and web development and I have seen some sites that have example a submit button or just an input where when the mouse/ cursor goes over the top of the element it would change the element,
To explain a bit better, the submit button might be red and black text, and if you hover over the submit button it would go black and change to red text,
I just wanted to know how that was done cause I would like to put that on my sites, thanks!
I have searched google alot for information on how to do this but I have come up with nothing, best regards,
Jack.
Use the :hover selector. See the following examples, how to do that:
button,
input[type="submit"] {
background-color:#000;
color:#f00;
}
button:hover,
input[type="submit"]:hover {
background-color:#f00;
color:#000;
}
<button>Test</button>
<input type="submit" value="Test"/>
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am adding image using following css
{
background-image: url(../images/icon_new_reset.png);
background-repeat: no-repeat;
}
Then how to give alternate text or add text over background image.
if you use textarea you can't add text with css
but if you use div or ... you can add text using this:
<div class="testDiv"></div>
your style is like this:
.testDiv:after{
content: "your text";
}
by the way it's better use javascript or jquery for changing value or text.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Created a div with a unique class applied to it in the file bootstrap unique styles, but when the page loads, they disappear. How to understand that their erasure and fix it?
.slider-container {
height: 100%;
position: absolute;
z-index: -11;
}
My site is - http://tourlly.com/new/
http://i.imgur.com/MvkTHzT.png
in your CSS. Check it. And try use validator for markup
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How can I set the top position of a div 30*n. N is the number of div inside the outer div (And all that without javascript). For exemple.
#div1
{
top:#div1>numberOf(div)*30+"px";
}
You can't perform any calculations within CSS. The closest thing to what you want is to use PHP to edit inline CSS.
For example:
<?php $answer = result of calculation ?>
<div id="div1" style="top: <?php echo $answer; ?px">...</div>
I can't think of anyway of getting the answer without using javascript.