The errors didn't come up earlier... i just noticed it last night when i tried to save my file. what could be wrong? Cause i have had a look at the HTML code and nothing is seems off.
footer {
background-color: #023440;
padding: 30px;
margin-top: 800px;
bottom: 0px;
}
.logo-footer {
height: 70px;
width: auto;
float: left;
margin-top: 60px;
margin-left: -20px;
margin-bottom: 25px;
cursor: pointer;
}
.footer-nav {
list-style: none;
float: none;
margin-bottom: 20px;
}
.social-links {
list-style: none;
float: right;
margin-top: -40px;
padding-right: 5px;
}
.footer-nav li,
.social-links li {
display: inline-block;
margin-right: 20px;
font-size: 90%;
}
.footer-nav li:last-child,
.social-links li:last-child {
margin-right: 0;
}
.footer-nav li a:link,
.footer-nav li a:visited,
.social-links li a:link,
.social-links li a:visited {
text-decoration: none;
border: 0;
color: #a3a3a3;
font-weight: 400;
transition: color 0.3s;
}
.footer-nav li a:hover,
.footer-nav li a:active {
color: #fff;
font-weight: 400;
}
.social-links li a:link,
.social-links li a:visited {
font-size: 135%;
}
.footer-address p {
color: #fff;
font-size: 90%;
display: block;
float: left;
line-height: 1.5;
margin-bottom: 30px;
}
.copyright {
color: #fff;
text-align: center;
font-size: 80%;
display: block;
margin-left: 0px;
margin-top: 25px;
}
.copyright:before {
display: block;
height: 0.1px;
background-color: #045d71;
content: " ";
width: 100%;
margin: 0 auto;
margin-bottom: 25px;
}
.ion-social-linkedin,
.ion-social-instagram,
.ion-social-twitter {
transition: color 0.3s;
}
.ion-social-linkedin:hover {
color: #007bb5;
}
.ion-social-instagram:hover {
color: #e95950;
}
.ion-social-twitter:hover {
color: #55acee;
}
.email-footer {
text-decoration: none;
color: #fff;
transition: color 0.3s, border-bottom 0.3s;
}
.email-footer:hover {
color: #a3a3a3;
border-bottom: 0.5px solid #a3a3a3;
}
<footer>
<div class="row">
<div class="span-3-of-3">
<ul class="footer-nav">
<li>Home</li>
<li>About Us</li>
<li>Services</li>
<li>Projects</li>
<li>Products</li>
<li>Blog</li>
</ul>
</div>
<div class="span-3-of-3">
<ul class="social-links">
<li><i class="ion-social-linkedin"></i></li>
<li><i class="ion-social-instagram"></i></li>
<li><i class="ion-social-twitter"></i></li>
</ul>
</div>
</div>
<div class="row">
<div class="span-3-of-3">
<img src="resources/img/euphoric%20Logo%20footer-01.png" alt="euphoric-logo-footer" class="logo-footer">
</div>
</div>
<div class="row">
<ul class="footer-address">
<p>40 Alison Road.<br>
<a class="email-footer" a href="#">info#euphoric.co</a></p>
</ul>
</div>
<div class="row">
<p class="copyright"> Copyright © 2020, Euphoric. All rights reserved.</p>
</div>
</footer>
The errors didn't come up earlier... i just noticed it last night when i tried to save my file. what could be wrong? Cause i have had a look at the HTML code and nothing is seems off.
If you open your code in any text/code editor, you can see that there's plenty of errors in there, for example:
.pos-info: before {
there shouldn't be a space between the : and the before
padding: 0 auto;
chrome marks this as invalid
.img_description:hover {
transform
}
property without a value
.pos-content: after {
again, there shouldn't be a space between : and after
edit: more errors found:
On line 921
.cloud-content {
doesn't have a closing tag, which breaks everything after it. This is probably the cause of most of your problems.
Related
ul {
padding: 0;
margin: 0;
text-decoration: 0;
list-style: none;
background: #343434;
height: 20 px;
}
ul li a.home {
float: left;
color: white;
font-size: 24px;
line-height: 0px;
padding: 20px 100px;
margin: 0px 30px;
}
ul li a.home:hover {
background-color: white;
color: black;
transition: .5s;
}
ul {
list-style: none;
color: white;
}
ul li {
display: inline-block;
line-height: 80px;
}
.main ul {
display: none;
}
ul li a {
font-size: 18px;
color: white;
padding: 12px 100px;
border-radius: 2px;
}
a:hover {
text-decoration: none;
background: #A179C9;
color: black;
transition: .7s;
}
.main li:hover>ul {
display: block;
position: absolute;
}
<ul class="main">
<li><a class="home" href="index.html">blank</a></li>
<li>listen
<ul>
<li><a id="spotify" href="https://open.spotify.com/">spotify</a></li>
<li><a id="apple" href="https://open.spotify.com/">apple music</a></li>
</ul>
</li>
<li>gallery</li>
<li>download</li>
<li>store</li>
</ul>
The "spotify" and "apple music" block elements display in one line next to each other as opposed to below each other.
I also use bootstrap on the page. Not sure if it's got anything to do with the issue because when I remove the script it still works the same.
Sorry if my code is hard to see through.
It's the inline-block on ul li in your CSS. inline-block won't break the line. See MDN Inline Elements.
in css I marked my edits.
was it necessary?
ul {
padding: 0;
margin: 0;
text-decoration: 0;
list-style: none;
background: #343434;
height: 20 px;
}
ul li a.home {
float: left;
color: white;
font-size: 24px;
line-height: 0px;
padding: 20px 100px;
margin: 0px 30px;
}
ul li a.home:hover {
background-color: white;
color: black;
transition: .5s;
}
ul {
list-style: none;
color: white;
}
ul li {
display: inline-block;
line-height: 80px;
}
.main ul {
display: none;
flex-direction: column; /*add this it*/
position: absolute; /*add this it*/
}
ul li a {
font-size: 18px;
color: white;
padding: 12px 100px;
border-radius: 2px;
}
a:hover {
text-decoration: none;
background: #A179C9;
color: black;
transition: .7s;
}
.main li:hover>ul {
display: flex; /*add this it*/
position: absolute; /*add this it*/
}
<ul class="main">
<li><a class="home" href="index.html">blank</a></li>
<li>listen
<ul class="sub_main">
<li><a id="spotify" href="https://open.spotify.com/">spotify</a></li>
<li><a id="apple" href="https://open.spotify.com/">apple music</a></li>
</ul>
</li>
<li>gallery</li>
<li>download</li>
<li>store</li>
</ul>
My navbar is not centering properly and it's driving me nuts - there's slightly more white space on the left side of it. Thank you so much in advance. Here is the code
HTML:
<div class="navbar">
<ul class="navitems">
<li>
<a class="current" href="index.html">Home</a>
</li>
<li>
Podcasts
</li>
<li>
Articles
</li>
<li>
Merch
</li>
<li>
About Us
</li>
</ul>
</div>
CSS:
body {
margin:0
}
.navbar {
text-align: center;
border: 1px solid black;
width: 100%;
margin-left: auto;
margin-right: auto;
}
.navitems ul {
list-style: none;
}
.navitems li {
display: inline-block;
padding-top: 1.5%;
padding-bottom: 1.5%;
padding-right: 3%;
padding-left: 3%;
border: 1px solid blue;
width: 12%;
font-size: 20px;
}
.navitems a {
color: black;
text-decoration: none;
font-family: georgia;
}
.navitems li:hover a{
transition: all ease-in-out .5s;
color: #f88122;
text-decoration: underline;
}
<ul> tag has got default padding-inline-start style so it is needed to reset that value.
To align items in the middle, it is needed to set vertical-align: middle on <li> items.
.navitems ul indicates the <ul> selector inside .navitems selector. And from your html code, you should change it to ul.navitems.
Below is the working snippet.
body {
margin: 0
}
.navbar {
text-align: center;
border: 1px solid black;
width: 100%;
margin-left: auto;
margin-right: auto;
}
ul.navitems {
list-style: none;
padding-inline-start: 0;
}
.navitems li {
display: inline-block;
padding-top: 1.5%;
padding-bottom: 1.5%;
padding-right: 3%;
padding-left: 3%;
border: 1px solid blue;
width: 12%;
font-size: 20px;
vertical-align: middle;
}
.navitems a {
color: black;
text-decoration: none;
font-family: georgia;
}
.navitems li:hover a {
transition: all ease-in-out .5s;
color: #f88122;
text-decoration: underline;
}
<div class="navbar">
<ul class="navitems">
<li><a class="current" href="index.html">Home</a></li>
<li>Podcasts</li>
<li>Articles</li>
<li>Merch</li>
<li>About Us</li>
</ul>
</div>
If you check your code, you will find that your selector is wrong in the .navitems you don't need to add ul and there is padding-left for ul, so the padding should be zero.
Good luck
body {
margin:0
}
.navbar {
text-align: center;
border: 1px solid black;
width: 100%;
margin-left: auto;
margin-right: auto;
}
.navitems { /* Change the css selector */
list-style: none;
padding: 0 !important; /* Add this line */
}
.navitems li {
display: inline-block;
padding-top: 1.5%;
padding-bottom: 1.5%;
padding-right: 3%;
padding-left: 3%;
border: 1px solid blue;
width: 12%;
font-size: 20px;
}
.navitems a {
color: black;
text-decoration: none;
font-family: georgia;
}
.navitems li:hover a{
transition: all ease-in-out .5s;
color: #f88122;
text-decoration: underline;
}
<div class="navbar">
<ul class="navitems p-0">
<li><a class="current" href="index.html">Home</a></li><li>Podcasts</li><li>Articles</li><li>Merch</li><li>About Us</li>
</ul>
</div>
I am having trouble styling a basic nav.
I would like the nav menu colour to be grey and when it is hovered over turns to the green colour with a bottom border. It also jumps around on hover. I tried to add in border-bottom: transparent; but I think it is being overridden. I have played about moving the code and the a tag seems to be the culprit but I am not sure how to solve it. Hence all the styles.
HTML
<body>
<div class="header">
<img class="Logo" alt="Rigare logo" src="logoweb_1.1.png"/>
<div class="nav">
<ul>
<li>About</li>
<li>Technical Capabilities</li>
<li>Staff and Associates</li>
<li>Courses</li>
<li>Products and Hire</li>
<li>Contact</li>
</ul>
</div>
</div>
CSS
.header {
padding-top: 16px;
}
.logo {
float: left;
}
.nav {
display: inline-block;
vertical-align:top;
margin: 0;
padding: 10px 0;
text-align: center;
color: #70B0A8;
background: #fff;
}
.nav li{
display: inline;
text-align: right;
color: #70B0A8;
font-size: 20px;
font-weight: 700;
margin-right: 60px;
height: 100px;
opacity: 0.6;
border-bottom: transparent;
}
.nav li:hover {
color: #97A6AA;
border-bottom: 1px solid #97A6AA;
cursor: pointer;
padding: 10px;
}
a {
text-decoration: none;
}
.nav a {
color: #70B0A8;
}
Here is a fiddle to see what I'm talking about.
You have define
.nav a {
color: #70B0A8;
}
at the end of your CSS which will surely override your :hover effect and also you've defined :hover color for .nav li:hover { instead of .nav li:hover a { viz not a right way to define hover effect for a tag inside li.
Further you should first define the border-bottom and padding for your li tag initially instead of :hover to prevent the jumping issue.
You have to change your CSS like the Snippet below.
Code Snippet
a {
text-decoration: none;
}
.header {
padding-top: 16px;
}
.logo {
float: left;
}
.nav {
display: inline-block;
vertical-align: top;
margin: 0;
padding: 10px 0;
text-align: center;
color: #70B0A8;
background: #fff;
}
.nav li {
display: inline;
text-align: right;
color: #70B0A8;
font-size: 20px;
font-weight: 700;
margin-right: 60px;
height: 100px;
opacity: 0.6;
padding: 10px;
border-bottom: 1px solid transparent;
}
.nav li a {
color: #70B0A8;
}
.nav li:hover {
border-bottom-color: #97A6AA;
cursor: pointer;
}
.nav li:hover a {
color: #97A6AA;
}
<body>
<div class="header">
<img class="Logo" alt="Rigare logo" src="logoweb_1.1.png" />
<div class="nav">
<ul>
<li>About</li>
<li>Technical Capabilities</li>
<li>Staff and Associates</li>
<li>Courses</li>
<li>Products and Hire</li>
<li>Contact</li>
</ul>
</div>
</div>
The padding on your hover style was causing it to jump around.
Replace your .nav li:hover with the below.
.nav li:hover a{
color: #97A6AA;
text-decoration: underline;
cursor: pointer;
}
https://jsfiddle.net/c1egheLy/
So you remove the padding on hover and simply change the CSS around to suit what you need such as below:
.header {
padding-top: 16px;
}
.logo {
float: left;
}
.nav {
display: inline-block;
vertical-align:top;
margin: 0;
padding: 10px 0;
text-align: center;
color: #70B0A8;
}
.nav li{
display: inline;
text-align: right;
color: grey;
font-size: 20px;
font-weight: 700;
margin-right: 60px;
height: 100px;
opacity: 0.6;
border-bottom: transparent;
}
.nav li a:hover {
color: #70B0A8;
border-bottom: 1px solid #97A6AA;
cursor: pointer;
}
.nav a {
color: grey;
text-decoration: none;
}
<div class="header">
<img class="Logo" alt="Rigare logo" src="logoweb_1.1.png"/>
<div class="nav">
<ul>
<li>About</li>
<li>Technical Capabilities</li>
<li>Staff and Associates</li>
<li>Courses</li>
<li>Products and Hire</li>
<li>Contact</li>
</ul>
</div>
</div>
Im slightly baffled as to why you don't have your logo beside the menu links too but thats simply moving the <img> into <class="nav"> but then within this instance you'd need to add width:100%; to .nav {} CSS
Replace this lines in your code
.nav li:hover {
color: #97A6AA;
border-bottom: 1px solid #18961d; //Green Color
cursor: pointer;
/* padding: 10px; */ //Remove this padding line
}
I hope this helps..
When I hover on "Newsletter" it takes large space, I tried to adjust margin but nothing happened, and I also tried margin-left and margin-right but the problem is the same. Below is the code:
hr {
margin: 0px;
}
body {
background: url(../images/bg.jpg);
background-repeat: no-repeat;
background-size: cover;
word-wrap: break-word;
}
h1 {
font-family: "Sacramento";
color: #F0FFF0;
}
.title >h1 {
color: #222;
transition: color 2s;
}
.title:hover >h1 {
color: #6565f0;
}
.title {
line-height: 40px;
margin-top: 0px;
margin-bottom: -22px;
font-size: 19px;
transition: font-size 0.4s;
}
.title:hover {
font-size: 22px;
}
.nav ul {
background-color: transperent;
list-style: none;
padding: 0;
margin: 0;
text-align: center;
}
.nav li {
font-family: 'Oswald', sans-serif;
font-size: 1.2em;
line-height: 40px;
margin-top: 10px;
height: 40px;
border-bottom: 1px solid #888;
transition: font-size 0.4s;
}
.nav li:hover {
font-size: 1.6em;
}
.nav a {
text-decoration: none;
color: #222;
display: block;
transition: .3s background-color;
}
.nav a:hover {
background-color: #005f5f;
}
.nav a.active {
background-color: #fff;
color: #444;
cursor: default;
}
#media screen and (min-width: 600px) {
.nav li {
width: 120px;
border-bottom: none;
height: 50px;
line-height: 50px;
font-size: 1.4em;
}
/* Option 1 - Display Inline*/
.nav li {
display: inline-block;
margin-right: 10px;
margin-left: 10px;
}
}
<font align=center>
<div class="title">
<h1>Welcome</h1>
</div>
</font>
<hr />
<div class="nav">
<ul>
<li class="home">Home
</li>
<li class="tutorials">Tutorials
</li>
<li class="about">About
</li>
<li class="news"><a href="fb.com" target=_blank>Newsletter</a>
</li>
<li class="contact">Contact
</li>
</ul>
</div>
<hr style="margin-top:5px;" />
Update width of li to width:130px;
.nav li {
width:130px;
}
I have a quick question, can anyone help me out with making my menu look like the the on this website:
https://forums.digitalpoint.com/threads/please-help-with-css-navigation-overhang.2102229/
I have tried several things now and just can't seem to get it...
My current code is:
HTML:
<div class="navbar">
<ul>
<li>HOME</li>
<li>TREATMENTS</li>
<li>CONTACT</li>
<li>OTHER</li>
</ul>
</div>
CSS:
/*Content for Navigation Bar*/
.navbar {
width: 760px;
padding-left: 200px;
height: 50px;
background-color: #534b49;
text-align: center;
float: left;
font-size: 20px;
padding-top: 0px;
padding-bottom: 0px;
}
.navbar ul {
}
.navbar ul li {
list-style: none;
text-align: left;
}
.navbar li {
float: left;
padding-right: 15px;
}
.navbar li a {
color: #fff;
text-decoration: none;
}
.navbar li a:hover {
color: #00a6bd;
text-decoration: none;
}
.navbar li a#active {
color: #00a6bd;
text-decoration:none;
}
Thanks in advance!
Jock
Here is the latest code :
Html
<div>
<div class="navbar">
<div class="cornerl"></div>
<ul>
<li>HOME</li>
<li>TREATMENTS</li>
<li>CONTACT</li>
<li>OTHER</li>
</ul>
<div class="cornerr"></div>
</div>
<div class="strip" style="clear:both"> </div>
</div>
css
.navbar {
position: relative;
width: 760px;
padding-left: 200px;
height: 50px;
background-color: #004080;
text-align: center;
float: left;
font-size: 16px;
padding-top: 0px;
padding-bottom: 0px;
}
.navbar ul {
}
.navbar ul li {
list-style: none;
text-align: left;
}
.navbar li {
float: left;
}
.navbar li a {
padding:12px;
padding-bottom:15px;
color: #fff;
text-decoration: none;
}
.navbar li a:hover {
color: #00a6bd;
border-radius:3px;
text-decoration: none;
background:#ff7000;
color:#534b49;
}
.navbar li a#active {
color: #00a6bd;
text-decoration:none;
}
.strip{
background-color: #ff7000;
height: 3px;
width: 948px;
margin-left: 7px;
}
.cornerl{
border-color: transparent #FF7000 transparent transparent;
left: -10px;
}
.cornerl,.cornerr{
position: absolute;
bottom: -10px;
z-index: -1;
border-style: solid;
border-width: 10px;
}
.cornerr{
float:right;
right:-10px;
border-color: transparent transparent transparent #FF7000;
}
here is the live example