• I want to use not just one

     element. Instead, I want to specifiy multiple.
    
    for instance:
    
    pre {
    	display: block;
    	font-family: monospace;
    	white-space: pre;
    	margin: 1em 0;
    	background-color: yellow;
    }

    But how the heck can I give that

     element a name ?
    
    so in my html code I want to write this:
    
    <pre class="yellow"> What ever is written within here has the YELLOW BG color ! </pre>
    
    How and where do I define "yellow" within the css file ?
    That this 
     above, knows it's the yellow 
     ?
    
    Damm.. I am not a coder, in facet I always hated it !
    
    Thank you for any little help

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey there kreativito,

    As far as I can see you do not need class yellow since you already set yellow background in the pre element with this:

    pre {
    	display: block;
    	font-family: monospace;
    	white-space: pre;
    	margin: 1em 0;
    	background-color: yellow;
    }

    If you’re looking to add yellow background to specific pre elements you should create a new class with yellow background in style.css, for example:

    .yellowbg {
    background-color: yellow;
    }

    After that you can add that class to pre element HTML, added to your example:

    <pre class="yellowbg"> What ever is written within here has the YELLOW BG color ! </pre>

    Hope this makes sense ??

    Best regards,
    Bojan

    Thread Starter kreativito

    (@kreativito)

    YOU ARE THE MAN !!!!!

    THANK YOU SO MUCH, THAT’s EXACTLY WHAT I WAS TRYING TO FIGURE OUT !!!!!

    Keep rocking !!!!

    Glad I could help ??

    Cheers,
    Bojan

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘CSS: How to use multple elements ?’ is closed to new replies.