1

[EDIT] [SOLVED] I just replaced all my tag with tag with css as inline for all table that doesn't apply any bootstrap css class properties. Thanks all for reply.

In my yii app I having twitter bootstrap css and for some static pages I need css from style.css that I created.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html lang="en">
   <head>
     <style type="text/css">
        #mystyle
        {
          /* my styles classes */
        }
     </style>
     </head>
     <body>
     <div class="mystyle">
       /* html */
     </div>
  </body
 </html>

here bootstrap css is also get applies.

how can i restrict this html page not to include bootstrap css??

I tried by using tag but that not work.

Siguza
  • 21,155
  • 6
  • 52
  • 89
FSShaikh
  • 125
  • 3
  • 18

3 Answers3

0

how are you adding bootstrap? are you using an extension that adds bootstrap?
if so then you can use $this->renderPartial('path/to/full_view_with_layout'); in order to dismiss bootstrap, however I think that this is a wrong way to solve the problem. the best practise way is to include your overriding style right after the <body> tag or before the place you use it.
or you may have a property to disable the bootstrap in your extension.

iamawebgeek
  • 2,713
  • 1
  • 18
  • 34
0

i have another Approach, i dont know how much it will help you!

Give your own name to CSS class

If same class already exist and you are not able to change the class name, You can add !important property to CSS so that bootstrap CSS will not apply.

for example

<style type="text/css">
        #mystyle
        {
          color:#000!important;
        }
</style>
Manjunath Siddappa
  • 2,126
  • 2
  • 21
  • 40
0
document.styleSheets[0].disabled = true;
//so in your case using jquery try

$('link[title=mystyle]')[0].disabled=true;

Please visit, another approach answered here

Removing or replacing a stylesheet (a <link>) with JavaScript/jQuery

Community
  • 1
  • 1
Manjunath Siddappa
  • 2,126
  • 2
  • 21
  • 40