Background color of text in CSS?












-7















Any idea how can I make simpl text looking like this using css3?
button-type



btntype



info



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;


}










share|improve this question

























  • 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
















-7















Any idea how can I make simpl text looking like this using css3?
button-type



btntype



info



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;


}










share|improve this question

























  • 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














-7












-7








-7








Any idea how can I make simpl text looking like this using css3?
button-type



btntype



info



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;


}










share|improve this question
















Any idea how can I make simpl text looking like this using css3?
button-type



btntype



info



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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












1 Answer
1






active

oldest

votes


















-1














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 :)






share|improve this answer























    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    -1














    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 :)






    share|improve this answer




























      -1














      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 :)






      share|improve this answer


























        -1












        -1








        -1







        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 :)






        share|improve this answer













        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 :)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 20 '18 at 10:39









        ZenonlineZenonline

        828




        828






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

            SQL update select statement

            WPF add header to Image with URL pettitions [duplicate]