Unable to override Bootstrap in layout.html

58 views
Skip to first unread message

Tom Campbell

unread,
May 3, 2018, 7:47:35 PM5/3/18
to web2py-users
Goal is to change the color, size, and eventually default font of Bootstrap 4 navbar.
The following seemed to have no effect in web2py-bootstrap4.css (not the final colors! Just wanted contrasting ugly ones to make sure the experiment worked!)

file: web2py-bootstrap4.cs
        .navbar-dark { color: rgba(255,0,0,0.5); }
       
.bg-dark { color: yellow; }


So in desperation I thought I'd just put it right in layout.htmlL

file: web2py-bootstrap4.cs
    <style>
         
/* TC: Experimental */
       
.navbar-dark { color: rgba(255,0,0,0.5); }
       
.bg-dark { color: yellow; }
   
</style>
     
 
</head>
 
<body>
   
<div class="w2p_flash alert alert-dismissable">{{=response.flash or ''}}</div>
   
<!-- Navbar ======================================= -->
   
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">



 Still no change to the nav bar. What am I screwing up? TIA

pbreit

unread,
May 4, 2018, 12:30:56 AM5/4/18
to web2py-users
I think the property you want is background-color

Tom Campbell

unread,
May 4, 2018, 2:28:20 AM5/4/18
to web2py-users
On Thursday, May 3, 2018 at 9:30:56 PM UTC-7, pbreit wrote:
I think the property you want is background-color


Not sure what you mean... the bootstrap source at https://github.com/twbs/bootstrap/blob/v4-dev/dist/css/bootstrap.css defines attributes like this:
.navbar-dark .navbar-brand {
  color
: #fff;
}

pbreit

unread,
May 4, 2018, 2:16:13 PM5/4/18
to web2py-users
I wasn't able to make color work either but background-color did seem to work. Maybe there's a transparency going on or something.
Reply all
Reply to author
Forward
0 new messages