Solved

css causing a box outline around selected element

Posted on 2010-11-25
5
407 Views
Last Modified: 2012-06-21
Hello,

I have a bug in my css that is causing a dotted box to be around a LI's A element after you click it.  I have my code below and thought it was something in the  .lavaLampBottomStyle li a class but I can't solve it.  Any ideas?

html:
<ul class="lavaLampBottomStyle" id="3">
						<li class="current"><a href="#">Home</a></li>
						<li><a href="#">Programs</a></li>
						<li><a href="#">Registration</a></li>
						<li><a href="#">Tuition Policies</a></li>
						<li><a href="#">Employment</a></li>
						<li><a href="#">Gallery</a></li>
						<li><a href="#">Events</a></li>
						<li><a href="#">Contacts</a></li>
					</ul>

Open in new window


CSS:
        .lavaLampBottomStyle {
			float:right;
            position: relative;
            height: 29px;
            width: 810px;
            background-color: transparent;
            padding: 10px;
            overflow: hidden;
			margin-top:15px;
        }
                .lavaLampBottomStyle li {
                    float: left;
                    list-style: none;
                }
                    .lavaLampBottomStyle li.back {
                        border-bottom: 2px solid #fefa8b;
                        width: 9px;
                        height: 30px;
                        z-index: 8;
                        position: absolute;
                    }
                    .lavaLampBottomStyle li a {
                        font: bold 14px arial;
                        text-decoration: none;
                        color: #FFFFFF;
                        outline: none;
                        text-align: center;
                        top: 7px;
                        text-transform: uppercase;
                        letter-spacing: 0;
                        z-index: 10;
                        display: block;
                        float: left;
                        height: 30px;
                        position: relative;
                        overflow: hidden;
                        margin: auto 10px;
                    }   
                        .lavaLampBottomStyle li a:hover, .lavaLampBottomStyle li a:active, .lavaLampBottomStyle li a:visited {
                            border: none;
                        }                     

Open in new window

shows the box outline
0
Comment
Question by:cgray1223
  • 2
  • 2
5 Comments
 
LVL 22

Expert Comment

by:remorina
ID: 34215253
This is usually fixed by using the outline:none but I see you already have it in your in your .lavaLampBottomStyle li a class , I'm not getting the outline in IE,FF, Safari or Chrome, can you please specify which browser are you getting this behaviour with ?

It might also be useful if you post a link to duplicate this if possible.
0
 

Author Comment

by:cgray1223
ID: 34215262
0
 
LVL 9

Accepted Solution

by:
darkapple earned 250 total points
ID: 34215314
try changing "outline:none "  to outline : 0;

check this link.
http://css-tricks.com/removing-the-dotted-outline/
0
 
LVL 22

Assisted Solution

by:remorina
remorina earned 250 total points
ID: 34215319
cgray1223:
I have tried your link in both IE7 and IE8 and I'm not getting any outlines, one thing I've noticed though is that it renders incorrectly in IE8 and FF as the orange background is not extending to the menu items and they're appearing invisible since they're white on a white background as I've attached below in the capture, in order to fix this you will need to specify overflow:hidden to the class .roundedcornr_content_906887 as below.
.roundedcornr_content_906887 {
margin:0 15px;
overflow:hidden;
}

Open in new window


On the other hand it's odd that I'm getting different results than yours on the same browser, however you might try to update the .lavaLampBottomStyle li a by adding the :link, :visited and :active as below and see if this would have any effect.
.lavaLampBottomStyle li a:link, .lavaLampBottomStyle li a:visited, .lavaLampBottomStyle li a:active {
                        font: bold 14px arial;
                        text-decoration: none;
                        color: #FFFFFF;
                        outline: none;
                        text-align: center;
                        top: 7px;
                        text-transform: uppercase;
                        letter-spacing: 0;
                        z-index: 10;
                        display: block;
                        float: left;
                        height: 30px;
                        position: relative;
                        overflow: hidden;
                        margin: auto 10px;
                    }   

Open in new window

0
 

Author Comment

by:cgray1223
ID: 34215431
I tried both solutions and neither had an effect.  I wonder if its some css inspection plugin I have enabled thats causing it.  

remorina, I had an open issue for the header not stretching.  Can you post your last response there so I can give you credit for the answer as it fixed FF and Chrome display.  Here is the link:

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_26639297.html
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AngularJS Page Control Understanding 5 39
Form not operating correctly. 1 22
Remove lines by logo 2 22
Target h5 of a div 3 6
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now