Can't change background on a footer - html

I'm trying to make the background of my footer dark grey. Here's the HTML:
<footer>
<div class="row">
<div class="col span-1-of-2">
<ul class="footer-nav">
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
</ul>
</div>
<div class="col span-1-of-2">
<ul class="social-links">
<li><i class="ion-social-twitter icon-small"></i></li>
<li><i class="ion-social-facebook icon-small"></i></li>
<li><i class="ion-social-instagram icon-small"></i></li>
<li><i class="ion-social-google icon-small"></i></li>
</ul>
</div>
</div>
</footer>
and here's the CSS:
footer {
background-color: #555;}
I think it's because the information in the two divs is covering up the footer. However, I've tried giving the divs their own class names and using the 'inherit' property and it hasn't worked. If anyone could give me some advice I'd very much appreciate it.

Add an "important" to the rule setting the background-color of the footer and you're set to fly:
<style type="text/css">
footer, footer div {
background-color: #555 !important;
}
</style>

Solution
Hi there! When I put only the code you provide to us in here http://www.play-hookey.com/htmltest/ A grey footer is created. I can only conclude that another command is overriding yours. The easiest way to fix this is by making it important
footer, footer{
background-color: #555 !important;
}
This is however, bad practice, and you should troubleshoot before doing that
Troubleshooting
Try putting your footer styling below all other styling, the browser might be reading something else and overwriting your code
Its not good practice but you could use inline styling
Or you can create a class and apply it to your footer, as those rank above styling the element

I know this might sound silly, but if you are running it on your browser to check, May I suggest deleting your browsing history?
I've had issues in the past which make my head scratch only to realize the solution is solved after I delete my browsing history (mainly the cache).

Unable to comment but I will provide this link where it is working as expected.
footer {
background-color: #555;
}
<footer>
<div class="row">
<div class="col span-1-of-2">
<ul class="footer-nav">
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
</ul>
</div>
<div class="col span-1-of-2">
<ul class="social-links">
<li><i class="ion-social-twitter icon-small"></i></li>
<li><i class="ion-social-facebook icon-small"></i></li>
<li><i class="ion-social-instagram icon-small"></i></li>
<li><i class="ion-social-google icon-small"></i></li>
</ul>
</div>
</div>
</footer>
Codepen

Related

How can I put href into my code in dropdown

So, I got my Dopdown for Languages, I want to make a href if I press on "English", how can I do that?
<div class="nav-wrapper">
<div class="sl-nav">
Sprache:
<ul>
<li><b>Deutsch</b> <i class="fa fa-angle-down" aria-hidden="true"></i>
<div class="triangle"></div>
<ul>
<li><i class="sl-flag flag-de"><div id="germany"></div></i> <span class="active">Deutsch</span></li>
<li><i class="sl-flag flag-usa"><div id="germany"></div></i> <span>English</span></li>
<li><i class="sl-flag flag-cz"><div id="germany"></div></i> <span>Česky</span></li>
</ul>
</li>
</ul>
</div>
</div>
Im pretty new, to HTML and don't know where to put my href
You could put the a anchor in the whole li element, so it works by clicking on the text and also the flag:
<li><i class="sl-flag flag-usa"><div id="germany"></div></i> <span>English</span></li>
also, remember to change your ids, they're all germany now
You can add an anchor tag <a> on the elements:
<li><i class="sl-flag flag-usa"><div id="germany"></div></i>English</li>

Foundation sticky nav jumps when scrolling fast in Safari

I noticed that when I scroll upwards fast in Safari, the sticky nav jumps around, then I have to scroll slowly again to get it to click back into it's proper place. I'm using Foundation 6. Also, this is a new issue, as everything used to work just fine in Safari, but something must have changed in the past 4 months or so. See below for an example of the issue.
Here's the HTML for the nav bar. I haven't done anything special with the CSS.
<nav class="top-bar-container hide-for-small-only" data-sticky-container>
<div class="sticky sticky-topbar" data-sticky data-options="anchor: page; marginTop: 0; stickyOn: small;">
<div class="top-bar">
<div class="wrap">
<div class="top-bar-left">
<ul class="menu menu-hover-lines" data-magellan>
<li><a class="menu-options" href="home">Home</a></li>
<li><a class="menu-options" href="projects">Projects</a></li>
<li><a class="menu-options" href="articles">Articles</a></li>
</ul>
</div>
</div>
</div>
</div>
</nav>
The issue only arises in Safari. Chrome, etc. everything works fine. Has anyone else had this problem? Any help is appreciated.
Had the same problem. I added an id to the body tag and then anchored the top container to it.
<body id="the-body">
<div data-sticky-container>
<div data-sticky data-margin-top="0" data-top-anchor="the-body:top" data-stick-on="small">
<div class="top-bar topbar-sticky-shrink" id="top-menu">
<div class="top-bar-title">
NAME
</div>
<div class="top-bar-right">
<ul class="menu" data-magellan>
<li>FIRST</li>
<li>SECOND</li>
<li>THIRD</li>
</ul>
</div>
</div>
</div>
</div>

How to change color of footer?

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.

CSS Hover will not work on Navigation Bar

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/

The jquery accordion overlaps the content of my header

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