The attempt to center the buttons in the viewport using text-align:center
for nav
, ul
, and li
has proved ineffective. The alternative of nav {text-align: left;}
was no more successful.
CSS Snippets:
#container {
width: 100%;
background-color: black;
margin-left: auto;
margin-right: auto;}
main {
background-color: rgb(225, 234, 234);
display: block;
border-radius: 2em;
border-top: medium solid powderblue;
border-bottom: medium solid powderblue;
margin-left: 0.8em;
margin-right: 0.8em;
padding-top: 1em;
padding-right: 0.5em;
padding-bottom: 1em;
padding-left: 0.5em;}
.equip {
width: 100%;
margin-left: auto;
margin-right: auto;}
h1 {
color: powderblue;
text-align: center;
font-size: 1.7em;
font-family: cursive,fantasy,"Times New Roman";
font-style: italic;
white-space: nowrap;}
nav ul {
list-style-type: none;
border-radius: 2em;}
nav ul li {
text-align: center;
padding-bottom: 0.3em;
padding-top: 0.3em;
border-color: powderblue;
background-color: grey;
margin-bottom: 0.5em;
margin-top: 0.5em;
border-radius: 3em;}
nav a {
color: white;
font-family: "Times New Roman";
font-size: 1.3em;
white-space: nowrap;
text-decoration: none;}
footer {
margin-top: 1em;
padding-bottom: 1em;
text-align: center;
font-size: 0.8em;
color: white;}
- HTML Code:
<!DOCTYPE html>
<html lang="en-us">
<head>
<title>FFC|Home</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<link rel="stylesheet" href="stylesheet.css">
</head>
<body>
<div id="container">
<header>
<img class="equip" src="D:\ghanesh\ghanesh\Y Combinator\Intern Summer 2019\interning Prep Course\HTML Learn\Step-by-Step Guide\Forward Fitness Club\images\fitness club logo_grey_background.jpg"
alt="Forward Fitness Club ">
<h1>
Forward Fitness Club
</h1>
</header>
<nav>
<ul>
<li> <a href="About Us.html"> About Us </a> </li>
<li> <a href="Classes.html"> Classes </a></li>
<li> <a href="About Us.html"> About Us </a></li>
<li> <a href="Nutrition.html"> Nutrition </a></li>
<li> <a href="Contact Us.html"> Contact Us </a></li>
</ul>
</nav>;
<main>
<p>Welcome to Forward Fitness Club. Our mission is to help our clients meet their fitness <b>AND</b> nutrition goals. <br> </p>
<h2> FREE ONE-WEEK TRIAL MEMBERSHIP</h2>
<a href="Contact Us.html">Call Us today to Get Started</a> <br>
<h3>Fitness Club Hours</h3>
<p>
<ul style="list-style-type:none">
<li style="text-align:left"> Monday-Thursday: 6:00am - 6:00pm</li>
<li> Friday: 6:00am - 4:00pm</li>
<li> Saturday: 8:00am - 6:00pm</li>
<li> Sunday: Closed</li>
</ul>
</p>
</main>
<footer >
<address>
Copyright 2015. All Rights Reserved.<br>
<a style="color:powderblue" href="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9cfbf4fdf2f9eff4b2e8dcfbf1fdf5f0b2fff3f1">[email protected]</a>"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9bfdf4e9ecfae9fffdf2eff5fee8e8f8f7eef9dbfcf6faf2f7b5f8f4f6">[email protected]</a></a>
</address>
</footer>
</div>
</body>
</html>
Image 1 : Samsung Galaxy Note 2 viewport
Image 2 : Desktop browser viewport