2016-11-09 65 views
0

我用我的jsp頁面引導webjars(maven dependencies),我嘗試通過創建新樣式表覆蓋引導樣式表。但是,即使我尊重jsp頁面中樣式表的順序,並且將新樣式表添加到了servlet上下文中,我也看不到任何更改。任何想法如何解決這個問題?失敗覆蓋引導樣式表

這是servlet上下文:

<resources mapping="/resources/**" location="/resources/" /> 
<resources mapping="/webjars/**" location="/webjars/"/> 
<resources mapping="/bootstrap/css/**" location="/bootstrap/" /> 

,這將在JSP頁面的樣式表聲明:

<title>Home</title> 
<link href="webjars/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> 
<link href="/bootstrap/css/stylesheet.css" type="text/css" rel="stylesheet"> 
</head> 
<body> 

,這是樣式表我創建的,它不是COMPLET

body { 
background-color:lightblue !important; 
} 

h1{ 

color:navy !important ; 
margin-left: 20px !important; 
} 

回答

0

然後你可以應用相同的css代碼w你用你想要應用css的相同頁面的「!important」來死你...

<html> 
    <body> 
    <head> 
     <style> 
      ## YOUR CODE## 
     </style> 
    </head> 
    </body> 
</html> 
""