استبدال نص مكان نص من خلال how to replace word with css
استبدال نص مكان نص من خلال how to replace word with css
How to Replace Text with CSS pseudo-elements :before/:after
How do I replace a word in some text using CSS?
Best way to replace a text using CSS
hide the original content and replace it with a pseudo-element
(::after or ::before).
----------------------------------------------------------------
مثال:
----------------------------------------------------------------
اذا كان لديك كلمة باسم Hello وتريد تغييرها الى
Goodbye من خلال كود css
كود:
<button>Hello</button>
الحل :
كود:
button {
visibility: hidden;
}
button:after {
content:'Goodbye';
visibility: visible;
}
----------------------------------------------------------------
مثال اخر:
----------------------------------------------------------------
اذا كان لديك كلمة باسم
ABC وتريد تغييرها الى
DEF من خلال كود css
كود:
<div class="pvw-title"><span>ABC</span></div>
الحل :
كود:
.pvw-title span {
display: none;
}
.pvw-title:after {
visibility: visible;
}
----------------------------------------------------------------
اكواد اخرى :
----------------------------------------------------------------
كود:
.element {
text-indent: -9999px;
line-height: 0; /* Collapse the original line */
}
.element::after {
content: "New text";
text-indent: 0;
display: block;
line-height: initial; /* New content takes up original line height */
}
كود:
button {
position: absolute;
visibility: hidden;
}
button:before {
content: "goodbye";
visibility: visible;
}
كود:
span {
visibility: hidden;
word-spacing:-999px;
letter-spacing: -999px;
}
span:after {
content: "goodbye";
visibility: visible;
word-spacing:normal;
letter-spacing:normal;
}
كود:
.company-name{font-size: 0}
.company-name:after{
content: "New Company Name";
font-size: 14px;
}​
المرجع:
https://stackoverflow.com/questions/...-text-with-css
https://stackoverflow.com/questions/...ic-text-in-css
https://stackoverflow.com/questions/...text-using-css