Why cant I see my navigation bar , everything is right - html

I can't see the navigation bar even tho everything is right
Nothing is missing and its really getting frustrating now and I don't know what to do can someone help me please
<html>
<head>
<link href="app.css" rel="stylesheet" />
</head>
<body>
<header>
<div id="topbar">
</div>
<nav id="main">
</nav>
</header>
</body>
</html>
body{
margin: 0;
}
header{
background: url('./images/bg.png') bottom center no-repeat;
background-size: cover;
height: 750px;
}
#topbar {
height: 70px;
}
nav#main {
height: 150px;
color: white;
border-radius: 4px;
}

The problem is in your nav#main you only applied color:white property so the nav is displayed and it is white in color . As also your background-color is not set so it is not visible .
So apply a background-color property . See below snippet
body {
margin: 0;
}
header {
background: url('./images/bg.png') bottom center no-repeat;
background-size: cover;
height: 750px;
}
#topbar {
height: 70px;
text-align: center;
}
nav#main {
color: white;
background-color: red;
display: block;
padding: 10px;
border-radius: 4px;
}
#main a {
padding: 10px;
display: inline-block;
cursor: pointer;
}
#main a:hover {
background-color: green;
}
<html>
<head>
<link href="app.css" rel="stylesheet" />
</head>
<body>
<header>
<div id="topbar">
Hello
</div>
<nav id="main">
<a>View</a>
<a>Help</a>
<a>Data</a>
</nav>
</header>
</body>
</html>

Related

Responsive Background img + make text position where i want with responsive

I'm pretty much stuck on a site that I'm trying to build in the responsiveness part
And in the position of the text.
The img background -
What I try to do it to make the img background full cover in big screens
and on the small screen, I want that they will see the ball in the img - it only works for me for big screens.
Next to this, I want to put H1 and p, but I want it will be near the ball in the background img
My code:
/* hamburger */
const hamburger = document.querySelector("#hamburger");
const navUL = document.querySelector("#nav-ul");
hamburger.addEventListener('click', () =>{
navUL.classList.toggle('show');
});
html,body{
padding: 0;
margin: 0;
font-family: 'Rubik', sans-serif;
}
*{
box-sizing: border-box;
}
ul{
list-style: none;
}
a{
text-decoration: none;
color: #fff;
}
.container{
max-width: 1100px;
margin: 0 auto;
}
.btn{
background-color: #222f3e;
color: white;
padding: 6px 10px;
border-radius: 20px;
cursor: pointer;
}
.btn:hover{
color: #2e86de;
background-color: #fff;
}
/* Header */
header {
background-image: url(./img/main-img.jpg) ;
background-repeat: no-repeat;
background-position: bottom center ;
background-size: cover;
}
/* Navbar */
#navbar{
padding: 10px;
}
#navbar .container{
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-items: center;
}
.hamburger{
display: none;
background: transparent;
border: 0;
color: #fff;
font-size: 20px;
cursor: pointer;
}
.hamburger:focus{
outline: none;
}
#navbar ul{
padding-right: 0;
}
#navbar ul li {
display: inline-block;
font-size: 18px;
}
.logo a{
padding: 20px;
color: #fff;
}
/* Showcase Section */
#showcase{
min-height: 700px;
}
#showcase .container{
}
#media screen and (max-width: 767px){
#nav-ul{
display: none;
width: 100%;
}
#nav-ul.show{
display: flex;
justify-content: center;
}
.hamburger{
display: block;
}
}
<!DOCTYPE html>
<html dir="rtl" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<link href="https://fonts.googleapis.com/css2?family=Rubik:ital,wght#0,400;0,500;0,600;1,400;1,500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./mystyle.css">
<title>Football</title>
</head>
<body>
<header>
<nav id="navbar">
<div dir="ltr" class="container">
<h1 class="logo">
Natan Football
</h1>
<button class="hamburger" id="hamburger">
<i class="fas fa-bars"></i>
</button>
<ul id="nav-ul">
<li><a class="btn"href="#">צור קשר</a></li>
<li><a class="btn"href="#">מה מציעים</a></li>
<li><a class="btn"href="#">קצת עלינו</a></li>
<li><a class="btn" href="./index.html">דף הבית</a> </li>
</ul>
</div>
</nav>
<section id="showcase">
<div class="container grid">
<h1>some text asgfasfgfdfgdg</h1>
<p>dsgsdgdfgdfgdg</p>
</div>
</section>
</header>
<script src="./app.js"></script>
</body>
</html>
here i have provided a very basic code cause i don't have your full code.
I just added few css properties for you needs. If you run this code on big screen the .text will be top and center of the page. and you go in small screen text will be near the ball as you asked. You can even use px for height. It's just an example to show you.
body {
background: url("https://i.stack.imgur.com/08nIZ.jpg");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
height: 100vh;
position: relative;
}
.text {
position: absolute;
color: white;
text-align: center;
left: 50%;
transform: translateX(-50%);
}
#media screen and (max-width: 767px) {
body {
height: 40vh;
}
.text {
top: 50%;
}
}
<div class="wrapper">
<div class="text">
<h1>some text asgfasfgfdfgdg</h1>
<p>dsgsdgdfgdfgdg</p>
</div>
</div>
Let me know if it doesn't work for you.

css background image is messing up the body background color

The background for the whole page should be #111111. My navbar with a repeating background seems to change the color of the background that is under the navbar and above. I don't know what I am missing here
This is what I am getting:
This is what it should look like:
/index.html/
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>SomeWhere | Home</title>
<link href="./css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="container" >
<header>
<nav class="topnav">
</nav>
</header>
</div>
</body>
</html>
/style.css/
/* CSS Document */
body{
background-color: #111111;
}
#container{
width: 100%;
height: 100%;
background-color: #111111;
color: #ffffff;
}
nav.topnav{
margin: 0;
top: 138px;
left: 0;
width: 100%;
height: 54px;
background: #111111 url(../imgs/nvbck.png) repeat;
position:absolute;
z-index:-1;
}
Looks ok when I replicate it:
https://jsfiddle.net/Sixtus78/97r4mm39/
/* CSS Document */
body{
background-color: #111111;
}
.container{
width: 100%;
height: 100%;
background-color: #111111;
color: #ffffff;
}
nav.topnav{
margin: 0;
top: 138px;
left: 0;
width: 100%;
height: 54px;
background: #111111 url(http://cdn.backgroundhost.com/backgrounds/subtlepatterns/bo_play_pattern.png) repeat;
position:absolute;
z-index:-1;
}
<div class="container" >
<header>
<nav class="topnav">
Nav
</nav>
</header>
<div class="hero">
Hero
</div>
<div class="content">
Content
</div>
<footer></footer>
</div>
After testing out several other browsers and seeing that this only happening in chrome, I reset chrome to default and restarted chrome without any results. I decided to completely uninstall chrome and do a fresh installation. This apparently fixed the issue I was having.

Hyperlink image link boundary

I have three social media images in a div at the bottom of the page. I have them placed center of the div but when i add the link to the image it pushes the other images away and the area around the image is linked as well.
On other sites I have not had this issues so I am not sure what is going on
Thanks
<head>
<link rel="stylesheet" type="text/css" href="assets/style.css" />
<link href="assets/hover.css" rel="stylesheet" media="all">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100' rel='stylesheet' type='text/css'>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>NolanD</title>
</head>
<body>
<div id="nav">
<header>
<div class="logo">NolanD</div>
<div id="logo">
</div>
<ul>
<li>Home</li>
<li>Portfolio</li>
<li>Contact</li>
</ul>
</header>
</div>
<body>
<div class="rowone">
</div>
<div class="rowtwo">
<p>
</p>
</div>
<div class="rowthree">
</div>
</div>
<div class="rowfour">
</div>
<div class="rowfive">
</div>
<div class="rowsix">
<img src="assets/images/linkedin.png " height="24 " width="24 " class="hvr-bounce-in " /></li>
<img src="assets/images/github-2.png " height="24 " width="24 " class="hvr-bounce-in " /></li>
</div>
</body>
And the CSS, where I think the issues is coming from.
html, body {
margin:0;
padding:0;
}
* {
margin: 0;
padding:0;
}
#nav {position:absolute;
width:100%;
height: 60px;
background:#F4F2F2 ;
text-align: right; left: 0; top: 0; }
#nav a { font-size:26px; padding: 3px; margin-right: 1rem; font-family: Roboto;
font-weight:100; }
#nav li { display: inline-block; }
#nav h1 { text-align: left; }
a { color:#1D7090; text-decoration: none; padding: 10rem; transition: .4s; }
.logo {
float: left;
color: #1D7090;
font-size: 26px;
font-family: Roboto;
font-weight:100;
line-height: 31px;
display: inline-block;
margin-left: 1rem;
}
body {
background-color:#6A6262;
}
.rowone {
background-color:#7DB3BF;
width: 100%;
height: 600px; }
.rowtwo {
text-align: center;
font-size:72px;
color:#000000;
padding-top: 1rem;
background-color:#F9F2F2;
width: 100%;
height: 540px;
}
.rowthree {
background-color:#B34042;
width: 100%;
height: 500px;
}
.rowfour {
background-color:#FF5700;
width: 100%;
height: 500px;
}
.rowfive {
background-color:#DDD39B;
width: 100%;
height: 500px;
}
.rowsix{
background-color:#3E3E3E;
width: 100%;
height: 175px;
text-align:center;
}
.rowsix img { display: block;
padding-top: 5rem;
text-align:center;
display:inline-block;
margin:5px 15px;
}
#media all and (max-width:600px) {
.logo { display:none; }
#nav {text-align: center; }
}
Try remove padding attribute you added for link at line :
a { color:#1D7090; text-decoration: none; padding: 10rem; transition: .4s; }
Btw : please reformat your code. It's to bad :(

Adjusting Height and Centering

I'm trying to replicate a header/nav (from www.mineplex.com) for my website, but I need some help. I'm trying, but it's not working. Your guys' help would be greatly appreciated. Here's the code I have so far.
body {
font-family: Helvetica;
margin: auto;
width: 100%;
}
#header {
background: #383838;
position: fixed;
top: 0;
width: 100%;
}
#container {
margin: 0 auto;
}
#logo {
color: white;
font-size: 15;
text-align: center;
}
<!DOCTYPE html>
<html>
<head>
<title>Website</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<!-- IGNORE THIS! THIS IS FOR LiveReload -->
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
<!-- IGNORE THIS! THIS IS FOR LiveReload -->
<div id="header">
<div id="container">
<div id="logo">
<h1>WEBSITE</h1>
</div>
</div>
</div>
</body>
</html>
Here is how to add the darker bar in your header. DEMO
HTML:
<div id="header">
<div id="container">
<div id="logo">
<h1>WEBSITE</h1>
</div>
</div>
<div class="header-bottom"></div>
</div>
CSS:
body {
font-family: Helvetica;
margin: auto;
width: 100%;
}
#header {
background: #383838;
position: fixed;
top: 0;
width: 100%;
}
#container {
margin: 0 auto;
}
#logo {
color: white;
font-size: 15;
text-align: center;
}
.header-bottom {
width:100%;
height:25px;
background:#1E2224;
box-shadow: 0px 5px 5px #888888;
}

Why don't my divs have the background color they need for my aboutme page

My question covers it all I cant figure out why my about section div's aren't using the color I set(White). I set it in my css, and for some reason it is not applying correctly. All help would be greatly appreciated
body {
width: 100%;
background: #444444;
}
/*Header styles*/
header {
width: 100%;
height: 77px;
background: #ffffff;
}
header #logo {
background: #444444;
display: inline-block;
width: 150px;
margin-left: 60px;
float: left;
}
header nav {
width: 40%;
height: 100%;
vertical-align: middle;
float: right;
margin-right: 60px;
}
header nav ul {
list-style-type: none;
margin: 0;
padding: 0;
}
header nav li {
height: 100%;
line-height: 77px;
display: inline-block;
margin-left: 55px;
}
header nav a {
color: #000000;
text-decoration: none;
text-transform: uppercase;
}
/*Homepage Styles*/
#homepage {
width: 100%;
background: #444444;
}
#homepage #banner-h {
margin-top: 56px;
height: 751px;
background: #ffffff;
}
#homepage #banner-h #bht {
height: 88px;
margin: auto;
color: #000000;
}
#aboutme {
height: 2400px;
}
.aboutsection {
height: 593 px;
border: 1px solid black;
background: #ffffff;
}
footer {
margin-top: 56px;
background: #ffffff;
width: 100%;
height: 166px;
}
footer #fom {
height: 90%;
text-align: center;
display: table;
width: 100%;
}
footer h1 {
display: table-cell;
vertical-align: middle;
}
/*# sourceMappingURL=style.css.map */
<!DOCTYPE html>
<head lang="en">
<meta charset="UTF-8">
<link rel="stylesheet" href="css/style.css"/>
<link rel="stylesheet" href="css/normalize.css"/>
<title></title>
</head>
<body>
<header>
<div id="logo">
<img src="img/logo/caseywoelfle.com.svg" width="150px" height="77">
</div>
<nav>
<ul>
<li>home</li>
<li>about me</li>
<li>portfolio</li>
<li>blog</li>
<li>contact</li>
</ul>
</nav>
</header>
<div id="aboutme">
<div class="aboutsecton"><p>Test</p></div>
<div class="aboutsecton"><p>Test</p></div>
<div class="aboutsecton"><p>Test</p></div>
<div class="aboutsecton"><p>Test</p></div>
</div>
<footer>
<span id="fom">
<h1>find out more about me</h1>
</span>
</footer>
</body>
</html>
It boils down to a simple typo. You are using .aboutsection in your CSS selector but your div has a class of aboutsecton, missing an i.
Instead of:
<div class="aboutsecion"><p>Test</p></div>
...it should be:
<div class="aboutsection"><p>Test</p></div>
p/s: In addition, your height declaration is not working because of an additional white space in the height declaration. It should be 593px not 593 px.
You mis-spelled section:
<div class="aboutsecton">
should be
<div class="aboutsection">
You mispelled aboutsection. You spelled it aboutsecton in your HTML.
<div class="aboutsecton"><p>Test</p></div>
Should be
<div class="aboutsection"><p>Test</p></div>
Good luck!