samedi 1 décembre 2018

Resize aid needed in Html and Css

When I resize my brand new html and css page, it doesn't look exactly how I want it too. Below is the ideal look of my website.

Image

However, when I go full screen, the website looks like this,

Full size

As you can see, the words on the page shift too much to the right, how could I fix this?

Here is my code.

<body>

<header>
    <div class="container">
      <h1 class="logo"></h1>

      <nav>
        <ul>
          <font color="white"><li><a href="#">Home</a></li></font>
          <font color="white"><li><a href="#">About</a></li></font>
          <font color="white"><li><a href="#">Pricing</a></li></font>
          <font color="white"><li><a href="#">Contact</a></li></font>
       </ul>
      </nav>
    </div>
  </header>

    </body>






body {
    margin: 0;
    background: white;
    font-family: 'Work Sans', sans-serif;
    font-weight: 800;
}

.container {
    width: 80%;
    margin: 0 auto;
}

header {

background-image: linear-gradient(darkblue, royalblue);
}

header::after {
  content: '';
  display: table;
  clear: both;
}

.logo {
  float: left;
  padding: 10px 0;
}

nav {
  float: right;
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

nav li {
  display: inline-block;
  margin-left: 70px;
  padding-top: 23px;

  position: relative;
}

nav a {
  color: white;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 14px;
}

nav a:hover {
  color: #000;
}

nav a::before {
  content: '';
  display: block;
  height: 5px;
  background-color: white;

  position: absolute;
  top: 0;
  width: 0%;


  transition: all ease-in-out 250ms;
}

nav a:hover::before {
  width: 100%;
}

Note: I borrowed this code from an excellent video on how to make a nav bar.

https://www.youtube.com/watch?v=FEmysQARWFU




Aucun commentaire:

Enregistrer un commentaire