0

I am trying to move the register button on my nav bar to the left, while having the rest on the left, could somebody help?

my code;


     <html>
   <head>
    <style>

    ul {
  list-style-type: none;
  margin: 5px;
  padding: 10px;
  overflow: hidden;
  background-color:#005EB8;
}

li {
 float: right;
}

li a {
  display: block;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}

li a:hover {
  background-color: #003087;
}
</style>
<body>
    <ul>
    <li><a href="doctors.html">DOCTOR LOGIN</a></li>    
    <li><a href="login.html">MHS LOGIN</a></li>
    <li><a href="admin.html">ADMIN LOGIN</a></li>
    <li><a href="ourdoctors.html">OUR DOCTORS</a></li>
    <li><a href="story.html">OUR STORY</a></li>
    <li><a href="findus.html">FIND US</a></li>
    <li><a href="register.html">REGISTER</a></li>
    </ul>
 </div>

sorry if my code is really bad

2
  • Do you mean you want to move it to the right? Commented Nov 16, 2019 at 18:54
  • i would like to keep doctors, login admin our doctors, story findus on the right hand side, but have register isolated on the left hand side of the nav bar (if possible?) Commented Nov 16, 2019 at 18:55

2 Answers 2

1

Add the following:

 ul li:last-child {
            float: left;
  }
Sign up to request clarification or add additional context in comments.

Comments

1

Use the float attribute:

   <body>
    <ul>
    <li style="float:left"><a href="register.html">REGISTER</a></li>
    <li><a href="doctors.html">DOCTOR LOGIN</a></li>    
    <li><a href="login.html">MHS LOGIN</a></li>
    <li><a href="admin.html">ADMIN LOGIN</a></li>
    <li><a href="ourdoctors.html">OUR DOCTORS</a></li>
    <li><a href="story.html">OUR STORY</a></li>
    <li><a href="findus.html">FIND US</a></li>
    </ul>
 </div>

1 Comment

i want to isolate register to the left hand side of the nav bar, whilst having the rest on the right hand side

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.