V
V
Viktor Gubanov2015-10-05 14:53:41
css
Viktor Gubanov, 2015-10-05 14:53:41

How to add a standard css class without overriding it?

I'm just starting to understand layout, so the following question arose.
Given: bootstrap
Task: to glue the footer to the bottom of the page.
Solution: I want to make the property margin-bottom of the body style: *footer height*px;
By default in bootstrap, this property is zero. I understand that I can change it to what I need, but it seems to me that editing the standard framework classes is bad? (correct if I'm wrong).
In this case, you need to write your own class and copy what suits me in the standard implementation and add your own? If so, how can I make sure that my class does not overlap the standard one, but complements it?
If there are other ways, I'd love to know!
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Ineshin, 2015-10-05
@viktor_viktor

Here's an example: jsfiddle.net/IonDen/x6psd6bh
When you declare a new class with the same name, you don't overwrite the previous one, you only add to it, or override some properties in it. This is the strategy that all bootstrap add-ons and themes work on, and you should do the same.

M
Maxim E, 2015-10-05
@creativeworm

just redefine the rules to what you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question