Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Urgent need help ASAP With CSS

Posted on 2016-11-16
5
Medium Priority
?
72 Views
Last Modified: 2016-11-16
Hi guys,


Having a nightmare trying to work out what is wrong with my code.

Basically I am trying to get the bottom border to align with the ul text, so it starts at the 1st li and ends on the download button.

Bare in mind I have put a pink background on temporeraly just to understand my positioning.

Here is what I have so far
Screen-Shot-2016-11-16-at-10.50.09.png
here is an example of what I am trying to achieve, I want the border to start and end on the white vertical lines and I need to get rid of the sections where the red cross are.
Screen-Shot-2016-11-16-at-10.50.09-c.png
Here is the code :

HTML

<div id="mainnav">
        <ul> 
            <li><a href="#">Home</a></li>
            <li><a href="#">About us</a></li>
            <li><a href="#">Features</a></li>
            <li><a href="#">Reviews</a></li>
            <li><a href="#">Pricing</a></li>
            <li class="download"><a href="#">Download</a></li>
        </ul>
     </div>     

Open in new window


CSS

/* START MAIN NAV  */

#mainnav {
    width: 100%;
    
}


#mainnav ul { 
float: right;
margin-top: 90px; 
margin-right: 50px;
border-bottom: 1px solid white; 
padding-bottom: 30px;
background-color: pink; 

   

}

#mainnav ul li {

display: inline; 
list-style-type: none;
font-weight: bold; 
margin-left: 20px; 


    
}

#mainnav ul li a {

color: white; 
text-decoration: none;


    
}
#mainnav ul li a:hover{
    
    color: #AF2621;
    
}


/* END MAIN NAV  */

Open in new window


Any help is highly appreciated, Thanks.
0
Comment
Question by:Mike Moore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 32

Expert Comment

by:Pawan Kumar
ID: 41889481
Try 1 Added width:

#mainnav ul 
{ 

float: right;
margin-top: 90px; 
margin-right: 50px;
border-bottom: 1px solid white; 
padding-bottom: 30px;
background-color: pink; 
width: 100%;   

}

Open in new window


try 2


#mainnav ul 
{ 

float: right;
margin-top: 90px; 
margin-right: 50px;
border-bottom: 1px solid white; 
padding-bottom: 30px;
background-color: pink; 
width: 300px;

}

Open in new window

0
 

Author Comment

by:Mike Moore
ID: 41889498
Unfortunately, Still no luck. But thanks for trying.
0
 
LVL 32

Accepted Solution

by:
Pawan Kumar earned 2000 total points
ID: 41889505
Try this

<html>
<head>
<style>
/* START MAIN NAV  */

#mainnav {
    float:left;
    
}


#mainnav ul { 
float: right;
margin-top: 90px; 
margin-right: 50px;
border-bottom: 1px solid white; 
padding-bottom: 30px;
background-color: pink; 
padding-left : 0px;
   

}

#mainnav ul li {

    display: inline;
    list-style-type: none;
    font-weight: bold;
    margin-left: 5px;
    margin-right: 5px;


    
}

#mainnav ul li a {

color: white; 
text-decoration: none;


    
}
#mainnav ul li a:hover{
    
    color: #AF2621;
    
}


/* END MAIN NAV  */
</style>
</head>
<body>
<div id="mainnav">
        <ul> 
            <li><a href="#">Home</a></li>
            <li><a href="#">About us</a></li>
            <li><a href="#">Features</a></li>
            <li><a href="#">Reviews</a></li>
            <li><a href="#">Pricing</a></li>
            <li class="download"><a href="#">Download</a></li>
        </ul>
     </div>     
</body>
</html>

Open in new window


Output

EE
0
 

Author Closing Comment

by:Mike Moore
ID: 41889510
that worked perfect, Thanks.
0
 
LVL 32

Expert Comment

by:Pawan Kumar
ID: 41889514
Welcome Mike !!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question