Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    4
    Member #
    17489
    So I've been working on some buttons with CSS for my navigation bar that change on roll over. I also added in some java so that when clicked they display a list with extended options below using display:none; display: block; etc. Everything is working fine now but I've got a minor aesthetic problem that I wanted to see if anyone had a fix for. Whenever I click the button that expands the list it gets a funny dotted border around it, like so around "About":

    http://i283.photobucket.com/albums/k...2/Picture5.png

    If anyone has any ideas on what's causing this or a line or two that will negate it that'd be great.

  2.  

  3. #2
    Senior Member diddy's Avatar
    Join Date
    Jun 2008
    Location
    Sydney, Australia
    Posts
    502
    Member #
    16955
    Can you give us the link to the site so we can see it ourselves? It will be easier than a screenshot. If you can't do that, then please post the HTML and CSS so we can help you, but I would suggest that going border="0" in HTML or border: 0; in CSS might do it

  4. #3
    Junior Member
    Join Date
    Oct 2008
    Posts
    4
    Member #
    17489
    I currently don't have hosting because this is sort of a side project. I've noticed that the links on this sites navigation bar have the dotted line when clicked as well. I'm not sure if it's a hack I'm looking for, I would've tried the border: 0; in my css but that would remove the colored borders I have on the top and bottom of my buttons to seperate them. Also while I'm at it I figured I'd ask this and I'm guessing it's something simple. I've got two sections I've tried to set up, main content and side bar, that are inside my container div and I want the sidebar to scale with the height of container so it consistantly covers the left side of the page. I've tried setting it to a percentage but that just makes it extend oddly and the text in main content overlaps behind the sidebar. Any thoughts? Thanks in advance.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <style type="text/css"> 
    <!-- 
    
    body  {
        font: 100% Verdana, Arial, Helvetica, sans-serif;
        background: #222222;
        margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
        padding: 0;
        text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
        color: #000000;
    }
    .twoColElsLtHdr #container { 
        width: 55em;  /* this width will create a container that will fit in an 800px browser window if text is left at browser default font sizes */
        background: #EFECCA;
        margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
        border: 2px solid #000000;
        margin-top: 5em;
        text-align: left; /* this overrides the text-align: center on the body element. */
    } 
    .twoColElsLtHdr #passfield { 
        width: 38em;  /* this width will create a container that will fit in an 800px browser window if text is left at browser default font sizes */
        background: #046380;
        margin-left: 49.5em; /* the auto margins (in conjunction with a width) center the page */
        /*text-align: right;  /* this overrides the text-align: center on the body element. */
        font-size:10px;
        padding-top: 3px;
        vertical-align: bottom;
    } 
    .twoColElsLtHdr #login { 
        margin-top: 3px;
    }
    .twoColElsLtHdr #header { 
        background: #046380;
        padding: 0 0px;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
        padding-bottom: 3px;
        margin-bottom: 0;
    } 
    .twoColElsLtHdr #header h1 {
        margin-bottom: 5px; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
        padding: 0px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
    }
    
    /* Tips for sidebar1:
    1. Be aware that if you set a font-size value on this div, the overall width of the div will be adjusted accordingly.
    2. Since we are working in ems, it's best not to use padding on the sidebar itself. It will be added to the width for standards compliant browsers creating an unknown actual width. 
    3. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColElsLtHdr #sidebar1 p" rule.
    */
    .twoColElsLtHdr #sidebar1 {
         
        width: 9.35em; /* since this element is floated, a width must be given */
        float: left;
        background: #5E4D48; /* the background color will be displayed for the length of the content in the column, but no further */
        border-right: 1px solid;
        padding: 15px 0; /* top and bottom padding create visual space within this div */
        margin-right: 1em;
    }
    .twoColElsLtHdr #sidebar1 h3, .twoColElsLtHdr #sidebar1 p {
        margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
        margin-right: 10px;
    }
    .twoColElsLtHdr #mainContent {
        margin: 0 0em 0 0em; /* the right margin can be given in ems or pixels. It creates the space down the right side of the page. */
        margin-top: 0em; 
    } 
    .twoColElsLtHdr #footer { 
        padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
        background:#EFECCA;
    } 
    .twoColElsLtHdr #footer p {
        margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
        padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
    }
    
    /* Miscellaneous classes for reuse */
    .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
        float: right;
        margin-left: 8px;
    }
    .fltlft { /* this class can be used to float an element left in your page */
        float: left;
        margin-right: 8px;
    }
    .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
        clear:both;
        height:0;
        font-size: 1px;
        line-height: 0px;
    }
    .twoColElsLtHdr #headline {
        font-family:Arial, Helvetica, sans-serif;
        font-size: 28px;
        color: #046380;
    }
    
    .twoColElsLtHdr #subhead {
        font-family:Arial, Helvetica, sans-serif;
        font-size: 14px;
        color: #222222;
    }
    .twoColElsLtHdr #news {
        font-family:Arial, Helvetica, sans-serif;
        font-size: 15px;
        color: #222222;
    }
    --> 
    </style><!--[if IE]>
    <style type="text/css"> 
    /* place css fixes for all versions of IE in this conditional comment */
    .twoColElsLtHdr #sidebar1 { padding-top: 30px; }
    .twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]-->
    
    <script type="text/javascript" src="javascript/navigation.js"></script>
    <link rel=StyleSheet href="menu.css" TYPE="text/css" />
    
    </head>
    
    <body class="twoColElsLtHdr">
    <div id="container">
      <div id="mainContent">
      <div id="header">
      <img src="images/bannerop1_full3.png" />
      <div id="passfield">
     <form method="post" action="mailto:youremail@email.com">Username: <input type="text" size="10" maxlength="40" name="name"> Password: <input type="password" size="10" maxlength="10" name="password">
       <div id="news"></div>
     </form> 
      </div>
       <!-- end #header --></div>
      <div id="sidebar1">
        <ul id="main_menu">  
          <li><a href="index.php">Home</a></li>           
          <li><a href="#" class="down" onclick="expand_nav(this); return false;">Files</a>
            <ul style="display: none;">
              <li><a href="/filler">Browse Categories</a></li>   
              <li><a href="/filler">Featured Files</a></li>
              <li><a href="/filler">Popular Files</a></li> 
            </ul>
    
          </li>   
          <li><a href="#" class="down" onclick="expand_nav(this); return false;">Projects</a>
            <ul style="display: none;">
                        <li><a href="Other webpages">Web Design</a></li>       
              <li><a href="http://www.cs.colostate.edu">Computer Science</a></li>             
              <li><a href="filler">Graphics</a></li>
              <li><a href="/images.php">Gallery</a></li>
              </ul>
    
          </li>
          <li><a href="/forums">Forums</a></li>
          
              <li><a href="blog">Blog</a></li>
            
          <li><a href="#" class="down" onclick="expand_nav(this); return false;">About</a>
            <ul style="display: none;">
              <li><a href="about.php">About Us</a></li>
              <li><a href="contact.php">Contact Information</a></li>         
            </ul>
    
          </li>
          <li><a href="#" class="down" onclick="expand_nav(this); return false;">Support</a>
                   <ul style="display: none;">
    
                
            <li><a href="/support">Contact Support</a></li>         
                    <li><a href="services">Services</a></li>  
            </ul>
          </li>
          
        </ul>
    
      <!-- </div> Don't know where this came from --><br />
       <br />
       <br />
       <br />
       <br />
       <br />
       <br />
       <br />
       <br />
       <p> </p>
       <p> </p>
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        
    
      <!-- end #sidebar1 --></div>
      <br />
      <br />
        <div id="headline">Website Mockup</div>
        <div id="subhead"> October 3rd, 2008</div><hr />
       <div id="news"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. </p>
        <p>Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce  varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id,  libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat  feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut,  sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh.  Donec nec libero.</p></div>
        <div id="headline">In other news...</div>
        <div id="subhead"> October 3rd, 2008</div><hr />
        <div id="news"><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. </p>
        <p>Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce  varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id,  libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat  feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut,  sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh.  Donec nec libero.</p></div>
         <div id="footer">
        <p>(c) 2008 NP Design</p>
        <!-- end #footer --></div>
        
        <!-- end #mainContent --></div>
        <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --> 
    <!-- end #container --></div>
    </body>
    </html>
    Menu.css

    Code:
    @charset "UTF-8";
    /* CSS Document */
    
    ul#main_menu {
        color: #EFECCA;
        margin-top: -15px; padding: 0;
        background-color:#5E4D48;
        border-left:1px solid #6b6659;    
        border-right:1px solid #6b6659;
        border-bottom:1px solid #4c3c37;
        border-top:1px solid #73645f;
        align: top;
    }
    ul#main_menu li {
        list-style: none;
        margin: 0;
        padding: 0;    
        font-size:12px;
    }
    ul#main_menu li a {
        color: #EFECCA;
        text-decoration:none;
        padding:7px;
        padding-left:14px;    
        padding-right:6px;
        width:128px;
        display:block;
        border-top:1px solid #73645f;
        border-bottom:1px solid #4c3c37;
    }
    ul#main_menu li a:hover {
        background-color: #4a3b36;
        border-top: 1px solid #41322d;
        border-bottom: 1px solid #41322d;
        color: #168aae;
    }
    ul#main_menu .selected {
        background-color: #504c41;
        border-bottom: 1px solid #5a5548;
        color: #fea849;    
        font-weight:bold;
    }
    /* IF there is a drop down here then we need an arrow */
    ul#main_menu .down {
        background-image: url(../images/interface/arrow.gif);
        background-repeat:no-repeat;
        background-position:130px;
    }
    ul#main_menu .down:hover {
        background-image: url(../images/interface/arrow_down.gif);
        background-repeat:no-repeat;
        background-position:130px;
    }
    /* When the drop down is open */
    ul#main_menu .down_open {
        background-image: url(../images/interface/arrow_down.gif);
        background-repeat:no-repeat;
        background-position:130px;
        background-color: #4a3b36;
        border-top: 1px solid #41322d;
        border-bottom: 1px solid #41322d;
        color: #168aae;
        font-weight:bold;
    }
    /* When the drop down is selected */
    ul#main_menu .down_selected {
    
        background-position:130px;
        background-color: #504c41;
        border-bottom: 1px solid #5a5548;
        color: #fea849;    
        font-weight:bold;
    }
    
    
    
    ul#main_menu ul {
        color: #231f20;
        margin: 0; padding: 0;    
        border-bottom:1px solid #8a8477;
    }
    ul#main_menu ul li {
        list-style: none;
        margin: 0;
        padding: 0;    
    }
    ul#main_menu ul li a {
        color: #545045;
        text-decoration:none;
        padding:6px;
        padding-left:14px;    
        padding-right:4px;
        width:130px;
        display:block;
        border:0;
        background-color: #d8d2c2;
        border-top:1px solid #e4decf;
        font-size:11px;
    }
    ul#main_menu ul li a:hover {
        color: #111111;
        background-color: #b4aea0;    
        border:0;
        border-top:1px solid #e4decf;
        font-weight:normal;        
    }
    ul#main_menu ul li .submenu-down {
        color: #ffffff;
        background-color: #7e755c;    
    }

  5. #4
    Junior Member
    Join Date
    Oct 2008
    Posts
    4
    Member #
    17489
    Well I figured out how to solve the link outline. It's a Firefox specific feature that you can disable with outline: none; in your link css content. I am still however stuck on getting the sidebar div to scale with the container. Any thoughts?

  6. #5
    Senior Member diddy's Avatar
    Join Date
    Jun 2008
    Location
    Sydney, Australia
    Posts
    502
    Member #
    16955
    I've got two sections I've tried to set up, main content and side bar, that are inside my container div and I want the sidebar to scale with the height of container so it consistantly covers the left side of the page. I've tried setting it to a percentage but that just makes it extend oddly and the text in main content overlaps behind the sidebar.

    That sounds familiar with another thread I read recently.
    http://www.webdesignforums.net/html_...gth_30481.html

  7. #6
    Junior Member
    Join Date
    Oct 2008
    Posts
    4
    Member #
    17489
    Indeed, I found that as well and forgot to post that I'd fixed the problem. Thanks


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:30 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com