4

For a website design, I am making a navigation bar which will sit on top, allowing users to have a quick view of what the site offers. In the picture below I show the problem graphically

Button Design Problem Sketched Out #navBar { position:absolute; top: 140px; left: 460px; width: 980px; height: 200px; background-color: rgb(246, 246, 246); overflow:hidden;

      }
      li {
          list-style: none;
      }
      .navButton {
          position: absolute;
          top: 65px;
          left: 0px;
          width: 350px;
          height: 75px;
          background-color:rgb(18, 65, 91);
          color: white;
          margin-left: 0px;
          display:inline-block;
          text-align: center;
          -moz-transform: rotate(270deg);
          -moz-transform-origin: 50% 50%;
          -webkit-transform: rotate(310deg);
          -webkit-transform-origin: 50% 50%;
          font-weight: bold;
      }
      div span {
          position: relative;
          top: 15px;
          font-size: 29px;
      }
      .navButton:nth-of-type(1):before {
          content:"";
          position:absolute;
          height:170px;
          width:350px;
          background-color:rgb(18, 65, 91);
          top:-165px;
          left:-50px;
      }
      .navButton:nth-of-type(8):after {
          content:"";
          position:absolute;
          height:170px;
          width:350px;
          background-color:rgb(18, 65, 91);
          top:65px;
          left:50px;
      }
      div span {
          position: relative;
          top: 15px;
          font-size: 29px;
      }
      .buttonContent {
          position: absolute;
          right: 200px;
          top: 50px;
          background-color: #F2F2F2;
          width: 300px;
          visibility: hidden;
      }
      .buttonContent a {
          text-decoration: none;
          color: black;
          font-weight: bold;
      }
      .buttonContent a:hover {
          color: rgb(18, 65, 91);
      }
      .navButton:hover > .buttonContent {
          visibility: visible;
      }
      </style>

    <div id="navBar" style="">
      <table>
         <tr>
           <td>
            <ul>
                  <li>
                    <div class="navButton" style="left:-40px;"> <span> Getting Started  </span>

                        <div class="buttonContent"> <a href="#"> More about Partner Portal</a>
                            </br>   <a href="#"> Discover 3DSWYM</a>
                            </br>
                        </div>
                    </div>
                    <div class="navButton" style="left:70px;"><span> Our Solutions  </span> 
                        <div class="buttonContent"> <a href="#"> Industry Sales Kits</a>
                            </br>   <a href="#"> Brand Sales </a>
                            </br>   <a href="#"> Other Product Lines </a>
                            </br>   <a href="#"> Discover R2014x</a>
                            </br>   <a href="#"> Discover R2014x</a>
                            </br>   <a href="#"> Packagin & Portfolio 2014x</a>
                            </br>
                        </div>
                    </div>
                    <div class="navButton" style="left:180px;"><span> Sales </span>

                        <div class="buttonContent"> <a href="#">Agreements & Policies</a>
                            </br>   <a href="#">Pricing</a>
                            </br>   <a href="#">Online Services</a>
                            </br>   <a href="#">3DEXPERIENCE Platform</a>
                            </br>   <a href="#">Sales Support R2014x</a>
                            </br>
                        </div>
                    </div>
                    <div class="navButton" style="left:290px;"><span> Marketing </span>

                        <div class="buttonContent"> <a href="#">Marketing R2014x</a>
                            </br>   <a href="#">Marketing & Communication</a>
                            </br>   <a href="#">Campaigns in-a-box</a>
                            </br>   <a href="#">Marketing Online Services </a>
                            </br>   <a href="#">Branding Materials</a>
                            </br>   <a href="#">Solutions Partner Labels</a>
                            </br>
                        </div>
                    </div>
                    <div class="navButton" style="left:400px;"><span>   Customer Support 
                      </span> 
                        <div class="buttonContent"> <a href="#">Our Mission</a>
                            </br>   <a href="#">Roles & Responsibilities</a>
                            </br>   <a href="#">Support Resources</a>
                            </br>   <a href="#">Dassault Systemes Partners Support Tool</a>
                            </br>
                        </div>
                    </div>
                    <div class="navButton" style="left:510px;"><span> Training </span> 
                        <div class="buttonContent"> <a href="#"> Training Programs</a>
                            </br>
                        </div>
                    </div>
                    <div class="navButton" style="left:620px;"><span> Technical Resources </span> 
                        <div class="buttonContent"> <a href="#">Pre-Sales Support R2014x</a>
                            </br>   <a href="#">VS Sales KickOff 2014 Presentations</a>
                            </br>   <a href="#">V6 Deployment Optimizations</a>
                            </br>   <a href="#">Dsx.client Portal</a>
                            </br>   <a href="#">3DSWYM Communities</a>
                            </br>
                        </div>
                    </div>
                    <div class="navButton" style="left:730px;"><span> Contact Us </span> 
                    </div>
                </li>
                <li></li>
            </ul>
        </td>
    </tr>
    </table>
   </div>

So i used the modified version that @BeatAlex helped me with, The fiddle is below

The jfiddle Link!

Now as you can see, there is the div-class: 'buttonContent', which appears below each respective navButton is now hidden due to the overflow hidden property

Codious-JR
  • 1,658
  • 3
  • 26
  • 48

2 Answers2

3

You can do overflow:hidden; on #navBar;

JSFiddle

Or increase the width to get it more diagonal and remove the border-radius.

JsFiddle

and with all bits coloured in:

JsFiddle

Albzi
  • 15,431
  • 6
  • 46
  • 63
  • that would solve that problem. But then i have another problem, well i didnot put the full code on the question. Because when the mouse hovers over a navButton, there is a div (buttonContent) that appears below it. So if i put overflow:hidden, then buttonContent is also hidden. Thus i need another work around it. I will put the whole code on the question. – Codious-JR Apr 29 '14 at 12:26
  • Please create a jsfiddle of it @Arj – Albzi Apr 29 '14 at 12:30
  • But damn man! Thats freaking awesome what you did! i learnt Loads from the ur code. i have never manipulated the nth-of-type. And extra thanks for the step by step progression. – Codious-JR Apr 29 '14 at 12:46
  • And i am getting right now it with the jsfiddle, I didnt know about it before now. haha – Codious-JR Apr 29 '14 at 12:46
  • No worries I'm glad I could help you in that way :) And thank you! As soon as you have the JSFiddle ready I'll take a look :) @Arj – Albzi Apr 29 '14 at 13:02
  • @BeatAlex. I made the jfiddle. Could you give it a look please? – Codious-JR May 02 '14 at 23:47
  • Sorry i was asleep! I will look in a bit! @arj – Albzi May 03 '14 at 10:12
0

You can add overflow: hidden to the #navbar element. If you don't want it to cut off the bottom/right you can use overflow-x or overflow-y

SEE FIDDLE

ediblecode
  • 11,701
  • 19
  • 68
  • 116