0

I have my stylesheet directory set up like this

stylesheets
    bootstrap.min.css
    style.css

In my style.css, I want to edit the pre tag like this:

pre {
    background-color: #d9edf7;
    border: #d9edf7;
    color: navy;
}

However, this is not getting picked up in the browser. It seems like the browser is going with the styles in bootstrap.min.css. This is what it looks like in Chrome's inspector tools when I hover over the block of pre tag:

enter image description here

So how do I get it to use my custom css instead?

3
  • make sure you include your custom css after the bootstrap css! Commented Jul 27, 2016 at 20:28
  • @sebastianbrosch ahh, I see, now it works Commented Jul 27, 2016 at 20:29
  • @sebastianbrosch thanks!! Commented Jul 27, 2016 at 20:30

2 Answers 2

1

You have to make sure you include your custom CSS after the Bootstrap CSS, like the following:

<head>
    <!-- don't include your custom CSS here! -->
    <link rel="stylesheet" type="text/css" href="bootstrap.css">
    <link rel="stylesheet" type="text/css" href="custom.css">
    <style>
        pre {
            background-color: #d9edf7;
            border: #d9edf7;
            color: navy;
        }
    </style>
</head>
Sign up to request clarification or add additional context in comments.

Comments

0

Place style.css after bootstrap.min.css, so style overrides bootstrap.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.