My website isn't scaling correctly when I try to resize it or view it on my phone. I've added the below META tags but it's not working. Please advise, thank you.
http://patricesprojects.info/atlanta/index.html
HTML
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="atlanta.css">
<link rel="stylesheet"href="https://fonts.googleapis.com/css?family=Pacifico">
<link rel="stylesheet"href="https://fonts.googleapis.com/css?family=Roboto">
</head>
<body>
<header id="header">
<div id="logo">
<img src="logohtml.png" alt="logo" id="header-img">
<span>Welcome to Atlanta!</span>
</div>
<nav id="nav-bar">
<ul>
<li><a class="nav-link" href="#"><b>Things to Do</b></a></li>
<li><a class="nav-link" href="#"><b>Where to Eat</b></a></li>
<li><a class="nav-link" href="#"><b>Events</b></a></li>
<li><a class="nav-link" href="#"><b>Hotels</b></a></li>
<li><a class="nav-link" href="#"><b>Parking</b></a></li>
</ul>
</nav>
</header>
</header>
This is what the site looks like after updating it. The first image is what it looked like prior to the update.
css code has many incorrect syntax
header image is contained unproperly. remove padding and add height: 70vh;
to #about-us
add for example padding: 0px 20px
to h1
to add some white space on the sides of headings
remove all paddings in ul
by setting it to 0
to remove extra left space included by default.
give the footer text-align: center;
to center its content.
Also all <img>
is overflowing on small devices/widths and it could be contained and responsive by adding the following styles.
img{
width: 100%;
height: 50vh;
object-fit: cover;
}
First your logo image should be cropped to remove all empty spaces around it. which will let you increase its size with no major effect in the height of the nav and without using position: absolute
. notice the difference in two images below:
you should use media queries to make it repsonsive to devices based on some breakpoints. read the following links about them
Here is a working exmaple for your navigation bar https://codepen.io/DohaHelmy/pen/xxbzzRN
It uses a mobile-first approach and it. Try to understand how it is made if you need to make it Desktop first. In addition Read this guide on flexbox to understand how to align and justify content using flex
which is used in the example.