Jon
Jon

Reputation: 278

MVC - CSS for a specific view

I have changed my css sheet for my entire site and it works great. The change has to do with the background color of rows in tables. Although it does what I want, there is one view that I would like to be exempt from this alteration. Is there a way to exclude this view from the change or create a new css sheet for this specific view?

Upvotes: 2

Views: 2086

Answers (2)

Jon
Jon

Reputation: 278

I figured out the solution which ended up being much easier than I expected. Since I am very new to using CSS and HTML I was unaware of the style tag. However, that is what I was looking for. For anybody looking at this in the future, just use:

<style>
    (CSS that you would like to override)
</style>

Upvotes: 0

beautifulcoder
beautifulcoder

Reputation: 11320

Well, I would come up with a CSS styling strategy. The goal should be to minimize CSS and overrides. Also, having an extra CSS file for just one page will cause an extra HTTP round trip to get the resource. My recommendation is to stick extra CSS classes on this view. Then, override precisely the styles that you need in your global CSS styles.

Upvotes: 3

Related Questions