无法弄清楚如何更改导航栏的颜色

时间:2019-10-20 13:04:48

标签: html css

这是导航栏HTML代码。

import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
import math
import sys

plt.interactive(False) 

sigma = 2320
rho = 1000
gravity = 9.81  # [m/s^2]
g = gravity*3600*3600  # [m/hour^2]
S = 0.01
settlingVelocity = 0.02  # [m/s]
ws = settlingVelocity*3600  # [m/hour]
n = 0.04 # [SI]

J = 400  # [Ws/m]
k = 0.02
Cstar = 0.2 * sigma  # [kg/m^3]
W = 2  # [m]

D0 = 1.2 
Lw = 20   
L = 100  

tend = 0.5  # in hours
tspan = np.linspace(0.0, tend, 5)


def d(t):  # metres
    if t < 50:  # hours
        return 0.5
    else:
        return 0.05

def Q(t):
    return 3600 * (math.sqrt(S)/n)*((W*d(t))**(5/3))/((2*d(t) + W)**(2/3))

def h(t):
    return d(t)/2

def beta(t):
    return (sigma - rho) * g * h(t)/sigma

def Omega(t):
    return rho * g * S * Q(t)  # [W/m]

def PsiTime(t):
    return rho * g * Q(t) * (D0 - d(t))/(Lw)

N = 10
X = np.linspace(0, L, N)
delX = L/ (N-1)

def odefunc(y, t):

    def zetaEh(t):
        return k * (PsiTime(t) + Omega(t)) / (J + beta(t))

    def zetaEW(t): 
        return (2*d(t)/(W + 2*d(t))) * k * Omega(t)/(J + beta(t))

    def zetaR(t):  
        return (W/(W + 2*d(t))) * k*Omega(t)/(beta(t))

    def zetaEF(t,i):
        return (W/(W + 2*d(t))) * k * Omega(t) / (J + beta(t))

    C = y[:N]
    M = y[N:]

    print("time: ", t)

    dCdt = np.zeros(X.shape)
    dMdt = np.zeros(X.shape)

    dCdt[0] = (  # forward difference for dCdx
                -Q(t) / (W*d(t)) * (C[1] - C[0]) / delX
                  + (zetaEh(t) / (W * d(t))) * ((Cstar - C[0]) / Cstar)
                - (ws * C[0] * (beta(t))) / (d(t) * (J + beta(t)))
        )
    dMdt[0] = 0

     # gully channel
    for i in range (1, N-1):  # central difference
        if M[i] + W *C[i] * ws - zetaR(t) * (Cstar - C[i]) / Cstar < 0:
            reMass = M[i] + W * C[i] * ws

            dCdt[i] = (
                    -Q(t) / (W*d(t)) * (C[i+1] - C[i - 1]) / (2*delX)
                        + 1 / (W * d(t)) * ((zetaEW(t) + zetaEF(t,i)) * (Cstar - C[i]) / Cstar
                                            + reMass * (1 - (beta(t))/ (J + beta(t))))
                        - C[i] * ws/d(t)
             )
            dMdt[i] = -M[i]
        else:
            dCdt[i] = (
                    -Q(t) / (W*d(t)) * (C[i+1] - C[i - 1]) / (2*delX)
                      + 1 / (W * d(t)) * (zetaEW(t) + zetaR(t)) * (Cstar - C[i]) / Cstar
                      - C[i] * ws / d(t)
                       )
            dMdt[i] = W * C[i] * ws - zetaR(t) * (Cstar - C[i]) / Cstar

    # Final node - backward difference
    if M[N-1] + W * C[N-1] * ws - zetaR(t) * (Cstar - C[N-1]) / Cstar < 0: 
        reMass = M[N-1] + W * C[N-1] * ws
        dCdt[N-1] = (
                -Q(t) / (W * d(t)) * (C[N-1] - C[N-2]) / delX
                + 1 / (W * d(t)) * ((zetaEW(t) + zetaEF(t, i)) * (Cstar - C[N-1]) / Cstar
                                    + reMass * (1 - (beta(t)) / (J + beta(t))))
                - C[i] * ws / d(t)
        )
        dMdt[N-1] = -M[N-1]

    else:
        dCdt[N-1] = (
                -Q(t) / (W * d(t)) * (C[N-2] - C[N - 1]) / delX
                + 1 / (W * d(t)) * (zetaEW(t) + zetaR(t)) * (Cstar - C[N-1]) / Cstar
                - C[N-1] * ws / d(t)
        )
        dMdt[N-1] = W * C[N-1] * ws - zetaR(t) * (Cstar - C[N-1]) / Cstar
    dydt = np.ravel([dCdt, dMdt])
    return dydt


init_C = 0.0 * np.ones(X.shape)
init_M = 0.0 * np.ones(X.shape)
init= np.ravel([init_C, init_M])

sol = odeint(odefunc, init, tspan)

conc = sol[:, :N]

css中的bg-secondary:

<nav class="navbar navbar-expand-lg bg-secondary text-uppercase fixed-top" id="mainNav">

也在CSS中我发现了这个(我不确定是否需要)

.bg-secondary {background-color: #c21d2b !important;}

将所有带有“辅助”颜色的东西都更改为服装颜色,但是没有用。 更改-将辅助颜色更改为costom颜色也不起作用。

我仍然停留在导航栏中,我认为整个模板的颜色都是这样称呼的,所以有人可以向我解释一下如何更改它。

1 个答案:

答案 0 :(得分:0)

所以我发现它确实发生了变化,但是刷新页面时却没有显示。 一位朋友告诉我,进行这些更改不会在您刷新时显示(通常通过按F5键),而是必须刷新cntrl + F5键,忽略缓存的内容并生成预期的结果