Need help with tech project on codepen

Hey guys. I am trying to do my Technical project on codepen. I’ve decided to do it on CSS that way I can go through all my notes and basically just repeat it again to better memorize. While trying to do so, I am trying to write the color css styles, I can’t get it to show the format of the style.
I want it to look like this:

<h2 style=”color: blue;”>hello</h2>

I have attempted to use:

<code><h2 style=”color: blue;”>hello</h2></code>

but when I try to, it only comes up as


Anyone know how to do this?

you want to display this line <h2 style=”color: blue;”>hello</h2> instead of just hello?

yes. I want the actual code to display on the finished product.

I am able to have an external style display without anything special, however I can not get the inline or internal style to display

thats how we do it

            &lt;!doctype html&gt;
            &lt;html lang="en-US"&gt;
                &lt;meta charset="utf-8"&gt;                
                &lt;meta name="generator" content="JSFiddle"&gt;
                &lt;meta name="description" content="Displaying your source code on web page."&gt;
                &lt;meta name="author" content="Anna Medvedeva"&gt;
                &lt;h1&gt;Displaying your source code on web page&lt;/h1&gt;
                &lt;p1&gt;Do you read, write and speak code? Learn how to share your skills!&lt;/p&gt;

would this be correct?

        .blue-text {color: blue;}

Hey @medic_83!

If your desired result is this

 <style> .blue-text {color: blue;} </style>

Then your code should be this

        .blue-text {color: blue;}
1 Like

YES! That worked! Thank you tons!!

1 Like