I'm new to HTML and CSS and can't figure out how I change the color of the footer that is found at http://materializecss.com/footer.html. Any help would be awesome, thanks!
If you want to use one of the Materialize colors, you can simply add red / orange / teal to your footer classes like this:
<footer class="page-footer pink lighten-1">
The class containing the colouring information about the footer is page-footer, so you can change the colour as shown below:
<style>
.page-footer {
background-color: blue;
}
</style>
Additionally you can set an ID to the footer and overwrite the existing settings, as shown:
HTML:
<footer id = "myFooter">...</footer>
CSS (inline):
<style>
#myFooter {
background-color: blue;
}
</style>
If the above doesn't work, try using !important to force the change like so:
<style>
#myFooter {
background-color: blue !important;
}
</style>
Check out this fiddle and the snippet below to see a live demonstration:
#myFooter {
background-color: blue;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css" rel="stylesheet" type="text/css" />
<footer id="myFooter" class="page-footer">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">Footer Content</h5>
<p class="grey-text text-lighten-4">You can use rows and columns here to organize your footer content.</p>
</div>
<div class="col l4 offset-l2 s12">
<h5 class="white-text">Links</h5>
<ul>
<li><a class="grey-text text-lighten-3" href="#!">Link 1</a>
</li>
<li><a class="grey-text text-lighten-3" href="#!">Link 2</a>
</li>
<li><a class="grey-text text-lighten-3" href="#!">Link 3</a>
</li>
<li><a class="grey-text text-lighten-3" href="#!">Link 4</a>
</li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2014 Copyright Text
<a class="grey-text text-lighten-4 right" href="#!">More Links</a>
</div>
</div>
</footer>
Manual colors
As already mentioned, you can go by the class and create some CSS:
.page-footer{
background-color: your color here;
}
Or designate an ID for the footer, and set the background-color like that.
Material colors using classes
If you want to use the material colors (see the list here) you can use classes, or copy-paste the hex value. If you go with the hex value, see the first snippet under "manual colors" for implementing.
If you use the color classes, it's just like any other element:
<footer class = "page-footer your-color-class">
For an instance:
<footer class="page-footer amber darken-2">
(darken-2 isn't necessary though, it's just as an example. In this case, I used amber darken-2 as the color)
SASS/SCSS using material classes
NOTE: SASS/SCSS requires a ruby compiler, and compiles to regular CSS. If you're not using .scss or .sass, this will not work.
If you're using SASS, there's another way (this is SCSS, the same should apply to SASS, just slightly different syntax):
.page-footer{
#extend .your-color-class;
}
Using the same colors as earlier, this would be:
.page-footer{
#extend .amber, .darken-2;
}
This uses the inheritance feature of SASS/SCSS. Note that this is only possible if you've downloaded and #imported the SCSS version of materialize, which it does officially have and support.
just add the color code of the color you require to class of footer
example
<footer class="page-footer blue-grey darken-4">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">Contacts Us</h5>
<p class="grey-text text-lighten-4">You can use rows and columns here to organize your footer content.</p>
</div>
<div class="col l4 offset-l2 s12">
<h5 class="white-text">Links</h5>
<ul>
<li><a class="grey-text text-lighten-3" href="#!">Link 1</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Link 2</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Link 3</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Link 4</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2014 Copyright Gautham J
<a class="grey-text text-lighten-4 right" href="#!">More Links</a>
</div>
</div>
</footer>
color codes available here Color codes
CSS:
footer {
background-color: red;
}
i looked at the css and found the class colouring the footer.
footer.page-footer {
background-color: #333333;
}
In your own CSS document, which you'll need to put after the materialise.css document you will need to add:
background-color: #fff;
to the footer class.
(The #fff can be changed for different colours visit htmlcolorcodes.com for more information)
I hope they this helps...
Just select your footer element tag and put some CSS background on it. For example.
footer{background:red;}
I tried this and it worked
footer.page-footer {
background-color:hotpink;
}
Just add classes, example, changing nav color below:
<nav class="teal lighten-2">
You need to use materialize framework. If you think the cascade precendence would work... think twice. This is something Materialize needs to rethink. They should not overwrite cascade styling rules, but I guess they do with JS.
Need to add the class to the element you want to apply the color.
<span class="blue-text text-darken-2">This is a card panel with dark blue text</span>
And gray is grey before you try to hit your head on the wall.
Related
This is my first work with css and Bootstrap. As shown in attached image, I want the green color of text TEST to be green to be applied to that all yellow highlighted rectangle. how can I do that? Also, I want to toggle the active color whenever I click on test1 and test2.
My code is as below
<nav class="navbar navbar-dark">
<div class="container-fluid">
<div class="row-fluid">
<nav class="col-md-11">
<span class="navbar-header">
<a href="/test/" class="navbar-item">
<img class="some-class"
src="<myUrl>">
</a>
<a tooltip-placement="bottom" uib-tooltip="${some-text}" class="navbar-brand-test" href="<myUrl>">TEST</a>
</span>
<ul class="nav navbar-nav">
<li class="test1"><a href="<myUrl>" >Test1</a></li>
<li class="test1"><a href='<myUrl>' >Test2</a></li>
</ul>
</nav>
</div>
</div>
</nav>
css for navbar-brand-test, I just updated the existing code:
.navbar-brand-test,
.navbar-brand-test:hover,
.navbar-brand-test:focus {
height: 50px;
line-height: 50px;
font-size: 1.4em;
letter-spacing: 0.05em;
padding: auto;
margin: auto;
color: #fff;
background-color: #5fc17c;
white-space: nowrap;
}
When I did as suggested by TKD21 in the answer below, It worked but as you see in second image, the BG collor filled the logo (yellow part in second image) as well. I want the logo to be separate than that BG color
Finally, below code did a trick. Slightly modified version of the answer by TKD21. Moved logo url below col-md-11 and added div instead of span
<nav class="navbar navbar-dark">
<div class="container-fluid">
<div class="row-fluid">
<nav class="col-md-11">
<a href="/test/" class="navbar-item"><img class="some-class"src="<myUrl>">
</a>
<div class="col-md-1 navbar-header" style="background-color: #5fc17c;">
<a tooltip-placement="bottom" uib-tooltip="${some-text}" class="navbar-brand-test" href="<myUrl>">TEST</a>
</div>
<ul class="nav navbar-nav">
<li class="test1"><a href="<myUrl>" >Test1</a></li>
<li class="test1"><a href='<myUrl>' >Test2</a></li>
</ul>
</nav>
</div>
</div>
</nav>
Now only issue I have is each tab should be active with green color when I click on Test1 or Test2. Will update here when I resolve it
If I understood your question correctly, you want the green background of the text "TEST" to be applied to ALL of the yellow triangle,yes?
If that is indeed the case, consider doing the following:
Change your <span class='navbar-header'> to <span class='col-md-1 navbar-header'> and add a color class or style rule of your choosing
Change your <span class='navbar-header'></span> to <div class='col-md-1 navbar-header'></div> and add a color class or style rule of your choosing
Though the two solutions seem identical, the second is less prone to breaking on window resize.
If you need a bigger green background size, just play around with the col-md-<number> Bootstrap classes.
The results from my testing can be seen here
Here is my code:
<div class="wrap">
<div id ="header">
<a href="index" class = "logo">
<img src = "logo.png" alt = "" />
</a>
<nav class="navigation">
<ul>
<li>Share</li> |
<li>Join</li> |
<li>See Safty Tips</li> |
<li>Settings</li>
</ul>
</nav>
</div>
<div class="wrapper">
<img src="accident.png" alt="">
<div id="right-content">
<h2>Hit and Run No Injuries</h2>
<p>2.610 miles from your new neighbor<br />
May 20, 2015 at 12.34 PM </p>
<h4>California HWP 2 - High Level</h4>
</div>
</div>
<div class="wrap">
<ul class="secure_v5">
<li id="li-incident">
<a class="inviteLink dark" href="/v5/Resources.aspx?IFrameURL=Invitationv5&vn=&gORn=1">See Incident Location</a>
</li>
<li id="login-signup">
<a class="button dark" href="V4/Login.aspx?v5=1">Share Incident with Friends</a>
</li>
</ul>
</div>
<div class="thanks">
<p>Sincerely,<br />
The AlertID Team</p>
</div>
<p style="text-align:center;">This sponsor is helping to protect your neighborhood</p>
<div class="footer-links">
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
and here is jsfiddle , (didn't include images)
When i run this code, some alignment is not correct,
I need something same like this
I just confused with which exact css can be used, Can anyone help me please?
Thanks,
Use HTML tables to control the design layout and some presentation. You may be used to using pure CSS layouts for your web pages, but that approach just won’t hold up in an email environment.
Use inline CSS to control other presentation elements within your email, such as background colors and fonts.
You just put div #right-content to right
try it on CSS.
#right-content {
float:right;
width:600px;
}
#right-content h2{
text-align:center;
}
I create a little attribute to h2 inside div #right-content
and define a fixed width for right-content. It's necessary because of attribute float: right.
Hey guys this is my second question so far on a website i'm re-designing for my boss. I'm trying have it where if the user hovers over "4-Color Offset Printing" the background of the div ID will change to another background-color. (Example blue). I've tried adding #4_color_offset_printing:hover to see if that will just simply change the background color. This usually works but on this navigation bar it seems to not be working. Right now the default background is green. I'd like it to turn blue when i hover over it. I'm trying to apply this affect to every link but if i could get one working i could figure out the rest.
The older style of the navigation bar is the Gray with the blue link hover affect. The last developer that designed the site decided to use inline CSS. I'm not a fan of inline, but even if i try to simply copy and paste his inline code to the main.css it does not take affect. I have no idea why that would be happening. If anybody has any advice that would be great!
Here is my Demo
<style type="text/css"></style></head>
<body class="desktop webkit webkit_525">
<div id="header">
<div class="content_width rel">
<a href="./Welcome to our site!_files/Welcome to our site!.html">
<div id="header_logo"></div>
</a>
<ul id="top_nav">
<li><a class="home_icon" href="./Welcome to our site!_files/Welcome to our site!.html">Home</a></li>
<li>Contact</li>
<li>Estimates</li>
<li>Help Center</li>
<li>Samples</li>
<li>Shopping Cart</li>
<li class="last-child">My Account</li>
</ul>
<ul id="loginbar" class="rounded">
<li>New Account</li>
<li class="last-child">Login</li>
</ul>
<div id="header_products"></div>
<div id="header_phone">Customer Service: (949) 215-9060</div>
<div id="product_search">
<input id="product_ti" class="default" type="text" value="Find A Product">
<input id="product_btn" type="button" value="Search">
<input id="product_default" type="hidden" value="Find A Product">
</div>
</div>
</div>
<div id="nav">
<ul id="nav_links" class="content_width_adjust">
<li id="4_color_offset_printing" style="width:183px; height:44px; background-color:#0C0; border-top: 4px solid #009ad6; -webkit-box-sizing: border-box; -moz-box-sizing: border-box;box-sizing: border-box;" class=""><a class="nav_parent narrow" href=""><span>4-Color Offset Printing</span></a></li>
<li id="large_format" style="width:139px" class=""><a class="nav_parent wide" href=""><span>Large Format</span></a></li>
<li id="1-2_color_printing" style="width:164px"><a class="nav_parent" href=""><span>1&2 Color Printing</span></a></li>
<li id="4_color_digital_printing" style="width:189px"><a class="nav_parent narrow" href=""><span>4-Color Digital Printing</span></a></li>
<li id="roll_labels" style="width:130px" class=""><a class="nav_parent wide" href=""><span>Roll Labels</span></a></li>
<li id="services" class="last " style="width:133px"><a class="nav_parent services" href=""><span>Services</span></a></li>
</ul>
</div>
An elements ID can't start with a number, only classes can. Removing the 4_ from '4_color_offset_printing' so you just have a ID of 'color_offset_printing' will allow you to target it in CSS.
If you really don't want to change your ID's, you can target ID's that begin with a number like this:
[id='4_color_offset_printing'] {
background: blue;
}
But I wouldn't recommend using that, it may not work well in all browsers. Best to do things the right way and not use numbers to start your ID's.
Need to add to the #nav_links li a:hover class
#nav_links li a:hover
{
background-color: blue;
}
https://jsfiddle.net/akdz7udj/7/
I want to remove the default box-shadow from the unordered list group in bootstrap.There is the default shadow in the list-group special. My html is as follows:
<div class="row">
<div class="container">
<div class="col-md-4">
<ul class="list-group special">
<li class="list-group-item">About Royal</li>
<li class="list-group-item">Message from MD</li>
<li class="list-group-item">Director's Profile</li>
<li class="list-group-item">Organization Structure</li>
<li class="list-group-item">Member Asssociation</li>
<li class="list-group-item">About Nepal</h2></li>
</ul>
</div>
</div>
<div class="col-md-8"></div>
</div>
</div>
I applied the following css:
ul.special{
box-shadow:none;
}
However, the default box shadow is always there? Plz help how to remove it?I would highly appreciate the help.
There's no box-shadow on the .list-group, look at the unpacked CSS https://github.com/twbs/bootstrap/blob/master/dist/css/bootstrap.css lines 5100 - 5120. If you want to remove the border then you can do the following in CSS that comes after the Bootstrap CSS.
**CSS **
.list-group.special .list-group-item {
border-width:0px;
}
I think you are talking about the border, not the shadow.
It is simply to change. You have to add one line to your CSS:
ul.special .list-group-item{
border: 0 !important;
}
I am using the jquery accordion source for my website and what happens when I scroll down is the accordion overlaps my header.
I haven't made any adjustments to the CSS code in the accordion class so I don't have much to show but I've read a lot of people complaining that the accordion source from jquery UI has this problem but I have not been able to find out what it is?
Any ideas? Thanks!
<script>
JQuery(document).ready(function(){
$("#accordion").accordion();
});
</script>
</a>
</div>
<nav class="nav">
<div class="padded">
<ul>
<li class="active"><a id="link1" class="nav-section1" href="#section1">About</a></li>
<li><a id="link2" class="nav-section2" href="#section2">Design</a></li>
<li><a id="link3" class="nav-section3" href="#section3">3D + Animation</a></li>
<li><a id="link5" class="nav-section5" href="#section5">Video Production</a></li>
<li><a id="link6" class="nav-section6" href="#section6">Contact</a></li>
<li class="scrollTop"><span class="entypo-up-open"></span></li>
</ul>
</div>
</nav>
<div class = "accordion">
<article>
<h1 id="section1">About</h1>
<p>Farman Pirzada is this one dude who's pretty awesome and there's a lot you should learn about him because I love him</p>
</p>
</article>
and here's the CSS
#accordion {
padding-left: 100px;
}
http://imgur.com/EaQOT0g