/    Sign up×
Community /Pin to ProfileBookmark

Overwrite bootstrep classes

How can I overwrite bootstrep classes ?
https://codepen.io/raul-rogojan/pen/dBKXrY?editors=0100

I am trying to fit this bootstrap carousel inside of the header and fit the imgs inside of the slide but I don’t know how.

to post a comment
CSSHTML

2 Comments(s)

Copy linkTweet thisAlerts:
@bastonesJul 03.2019 — If you're using the CDN, you would need to add your own CSS code after including the Bootstrap CDN stylesheet. Make sure you name the CSS classes the same as Bootstrap does, to avoid specificity issues. To learn more about how browsers handle situations where there is more than one rule matching a given HTML element, read this: https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity. You can also use the !important keyword on a CSS rule to force browsers to give that rule a higher priority over other rules before it, but this is not recommended as it can easily be misused by developers as a band-aid.

Using a CDN for a framework like Bootstrap is not recommended when you need to modify the default styles. If you are able to use a CSS preprocessor, you will be able to create your own CSS rules that override the defaults provided by Bootstrap before being compiled into CSS. In case you are not aware, Bootstrap is built with SASS, which is then compiled into CSS. You can learn more about SASS here: https://sass-lang.com.

There are many different tools you can choose from to help you compile SASS into CSS. Some IDEs have built-in support for this, such as [PhpStorm](https://www.jetbrains.com/phpstorm/) and [WebStorm](https://www.jetbrains.com/webstorm/). Other options to consider include Laravel Mix, which you bundle with your project as part of its development dependencies.

If you're quite new to web development and using CSS preprocessors is a little too daunting right now, you can still just add the CSS code within <style>...</style> tags after including the Bootstrap stylesheet in your HTML page, but I would still recommend you explore SASS so you can better understand how it can help you and why Bootstrap uses it.
Copy linkTweet thisAlerts:
@codyhillauthorJul 03.2019 — @bastones#1605803 So... I have to use SASS and the compile it to CSS ?
×

Success!

Help @codyhill spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...