Search code examples
csstextbackgroundformattingitalic

Can I change the background color for italic text?


I'm not really sure why my italic text has a black bg, but p { } is not getting it done and Google just tells me how to make italic text. full css // full html *Edit: You'll see I had to specify background-color for the headers, or they would have #000; bg's as well.

screenshot


Solution

  • The reason you have black background for all the elements even when you don’t specify anything is

    • {     background-color: #000;     color: #C3CCD3;     font-family: 'Roboto', sans-serif;     box-sizing: border-box; }

    Essentially this means that any element in the HTML should have the above properties.

    Also remove any #0b0b0b background color from your css. Since this too is almost like black color.

    Making text is possible using the tag. And the css should then be written for it as

    i {
        background-color: red; }