Classes with style

Classes with style
0

#1

When creating multiple classes is it ok to put them all within one set of style brackets to save typing the style bit everytime or is it better to put each class in its own style bracket. Im new to this!


#2

What do you mean? Can you give an example?

You can style code in the forum by using three backticks (found to the left of your 1 key up top, usually).

    ```
        .css-code {
           /* here */
        }
    ```

#3

Yes it is. for example class=“mydiv col-sm-4 pull-center text-left”


#4

<style> .red-text { color-red } </style>

So if I wanted to another class for something else, lets say font size for example would people normally put it within the existing two style tags or create a new style tag for each class


#5

@DTZee Yes, you only need one set of style tags.

<style>
    .red-text {
        color: red;
    }

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

#6

I’m sorry, I misunderstood.

{
color:red;
font-size: 14x;
}

You can have as many styling options as you need within the brackets as long as there is a semi-colon after each statement.


#7

thanks, im clear now


#8

thanks, i understand now


#9

Happy Coding! It gets more fun.