Background color of text in CSS?
Any idea how can I make simpl text looking like this using css3?
I only reached this using span :
span
a.nav-link span {
background-color: #00FFF0;
background-size: 50%;
text-decoration-color: black;
color: black;
background-position-x: 2rem;
}
css web frontend
add a comment |
Any idea how can I make simpl text looking like this using css3?
I only reached this using span :
span
a.nav-link span {
background-color: #00FFF0;
background-size: 50%;
text-decoration-color: black;
color: black;
background-position-x: 2rem;
}
css web frontend
you need a wrapper element around, like<div>
,<span>
, or<p>
. There is no plain text selector in CSS
– Matthias Seifert
Nov 20 '18 at 10:34
Added an answer to explain it a bid, but please add some code next time with what you have already tried.
– JeroenE
Nov 20 '18 at 10:38
2
you need to start learning CSS ...
– Temani Afif
Nov 20 '18 at 10:42
@JeroenE ofc you are right. I added the code
– adiush
Nov 20 '18 at 11:52
@MatthiasSeifert yeah i have span, but i dont know how style it..
– adiush
Nov 20 '18 at 11:53
add a comment |
Any idea how can I make simpl text looking like this using css3?
I only reached this using span :
span
a.nav-link span {
background-color: #00FFF0;
background-size: 50%;
text-decoration-color: black;
color: black;
background-position-x: 2rem;
}
css web frontend
Any idea how can I make simpl text looking like this using css3?
I only reached this using span :
span
a.nav-link span {
background-color: #00FFF0;
background-size: 50%;
text-decoration-color: black;
color: black;
background-position-x: 2rem;
}
css web frontend
css web frontend
edited Nov 20 '18 at 11:47
adiush
asked Nov 20 '18 at 10:32
adiushadiush
65
65
you need a wrapper element around, like<div>
,<span>
, or<p>
. There is no plain text selector in CSS
– Matthias Seifert
Nov 20 '18 at 10:34
Added an answer to explain it a bid, but please add some code next time with what you have already tried.
– JeroenE
Nov 20 '18 at 10:38
2
you need to start learning CSS ...
– Temani Afif
Nov 20 '18 at 10:42
@JeroenE ofc you are right. I added the code
– adiush
Nov 20 '18 at 11:52
@MatthiasSeifert yeah i have span, but i dont know how style it..
– adiush
Nov 20 '18 at 11:53
add a comment |
you need a wrapper element around, like<div>
,<span>
, or<p>
. There is no plain text selector in CSS
– Matthias Seifert
Nov 20 '18 at 10:34
Added an answer to explain it a bid, but please add some code next time with what you have already tried.
– JeroenE
Nov 20 '18 at 10:38
2
you need to start learning CSS ...
– Temani Afif
Nov 20 '18 at 10:42
@JeroenE ofc you are right. I added the code
– adiush
Nov 20 '18 at 11:52
@MatthiasSeifert yeah i have span, but i dont know how style it..
– adiush
Nov 20 '18 at 11:53
you need a wrapper element around, like
<div>
, <span>
, or <p>
. There is no plain text selector in CSS– Matthias Seifert
Nov 20 '18 at 10:34
you need a wrapper element around, like
<div>
, <span>
, or <p>
. There is no plain text selector in CSS– Matthias Seifert
Nov 20 '18 at 10:34
Added an answer to explain it a bid, but please add some code next time with what you have already tried.
– JeroenE
Nov 20 '18 at 10:38
Added an answer to explain it a bid, but please add some code next time with what you have already tried.
– JeroenE
Nov 20 '18 at 10:38
2
2
you need to start learning CSS ...
– Temani Afif
Nov 20 '18 at 10:42
you need to start learning CSS ...
– Temani Afif
Nov 20 '18 at 10:42
@JeroenE ofc you are right. I added the code
– adiush
Nov 20 '18 at 11:52
@JeroenE ofc you are right. I added the code
– adiush
Nov 20 '18 at 11:52
@MatthiasSeifert yeah i have span, but i dont know how style it..
– adiush
Nov 20 '18 at 11:53
@MatthiasSeifert yeah i have span, but i dont know how style it..
– adiush
Nov 20 '18 at 11:53
add a comment |
1 Answer
1
active
oldest
votes
not 100% sure what you are after but...
HTML
<p class = "red"> This text has a red background</p>
CSS
.red{
background-color:#f00;
}
Should do what I think you are asking BTW This is a great place to get some help but normally people will not help you unless you have shown what you have already tried to do, i.e. SO help those who are struggling to solve their own problems but wont help you if you just ask for questions without any proof that you have tried to tackle the problem first. For that people expect to get paid :)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53391042%2fbackground-color-of-text-in-css%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
not 100% sure what you are after but...
HTML
<p class = "red"> This text has a red background</p>
CSS
.red{
background-color:#f00;
}
Should do what I think you are asking BTW This is a great place to get some help but normally people will not help you unless you have shown what you have already tried to do, i.e. SO help those who are struggling to solve their own problems but wont help you if you just ask for questions without any proof that you have tried to tackle the problem first. For that people expect to get paid :)
add a comment |
not 100% sure what you are after but...
HTML
<p class = "red"> This text has a red background</p>
CSS
.red{
background-color:#f00;
}
Should do what I think you are asking BTW This is a great place to get some help but normally people will not help you unless you have shown what you have already tried to do, i.e. SO help those who are struggling to solve their own problems but wont help you if you just ask for questions without any proof that you have tried to tackle the problem first. For that people expect to get paid :)
add a comment |
not 100% sure what you are after but...
HTML
<p class = "red"> This text has a red background</p>
CSS
.red{
background-color:#f00;
}
Should do what I think you are asking BTW This is a great place to get some help but normally people will not help you unless you have shown what you have already tried to do, i.e. SO help those who are struggling to solve their own problems but wont help you if you just ask for questions without any proof that you have tried to tackle the problem first. For that people expect to get paid :)
not 100% sure what you are after but...
HTML
<p class = "red"> This text has a red background</p>
CSS
.red{
background-color:#f00;
}
Should do what I think you are asking BTW This is a great place to get some help but normally people will not help you unless you have shown what you have already tried to do, i.e. SO help those who are struggling to solve their own problems but wont help you if you just ask for questions without any proof that you have tried to tackle the problem first. For that people expect to get paid :)
answered Nov 20 '18 at 10:39
ZenonlineZenonline
828
828
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53391042%2fbackground-color-of-text-in-css%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you need a wrapper element around, like
<div>
,<span>
, or<p>
. There is no plain text selector in CSS– Matthias Seifert
Nov 20 '18 at 10:34
Added an answer to explain it a bid, but please add some code next time with what you have already tried.
– JeroenE
Nov 20 '18 at 10:38
2
you need to start learning CSS ...
– Temani Afif
Nov 20 '18 at 10:42
@JeroenE ofc you are right. I added the code
– adiush
Nov 20 '18 at 11:52
@MatthiasSeifert yeah i have span, but i dont know how style it..
– adiush
Nov 20 '18 at 11:53