Forums / Templates, Stylesheets, Page Layout / CSS to eliminate dotted box click in Firefox

CSS to eliminate dotted box click in Firefox

Locked

Views: 5,553

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
9 Aug 2007, 10:28 PM
#1
busymom avatar

busymom

New Zenner

Join Date:
Jul 2007
Posts:
61
Plugin Contributions:
0

CSS to eliminate dotted box click in Firefox

After googling a bit, I found the solution to getting rid of the dotted box on links. I just put a "a { outline:0; }" at the top of my stylesheet and that got rid of all the dotted box clicks I'd seen (e.g. categories in sidebox, nav buttons, etc) up until today. My development is all on an xampp localhost, so I can't provide a link. I'm using CSS Buttons (I have the mod installed, not the built-in level on ZC 1.3.7) for all of the buttons, so far, and on the form-type buttons like "Add to Cart" the obnoxious dotted box is back. I'm not familiar with forms in CSS or how these buttons work. Does anyone know what magic incantation I can use to get rid of the click border? I'm pretty sure it is a Firefox-unique display issue for now, but I REALLY dislike that dotted box!!

TIA, Karen

9 Aug 2007, 10:34 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,684
Plugin Contributions:
0

Re: CSS to eliminate dotted box click in Firefox

Have you tried applying the same property to the submit?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

10 Aug 2007, 2:12 AM
#3
busymom avatar

busymom

New Zenner

Join Date:
Jul 2007
Posts:
61
Plugin Contributions:
0

Re: CSS to eliminate dotted box click in Firefox

As I mentioned, I have no familiarity with forms and input buttons, so this is new to me. I did a little hunting around after reading your response and I intend to try it if I can figure out how. I'm having problems figuring out how to add the outline property for submit. I did try adding a blanket

*.submit:active { outline: none; }
in my main stylesheet but that didn't help (I figured it was a bit overkill, but it ought to at least work!), so I'm guessing either I'm misunderstanding how the submit is coded or I've got an error in my code.

Can anyone provide the code I need to try this to see if it makes the submit outline go away in Firefox?

TIA Karen

10 Aug 2007, 4:42 PM
#4
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: CSS to eliminate dotted box click in Firefox

Submit isn't a class, it's a thing. (That's a technical term. ;-) )

So you don't want the period in front of it. Period means class, just as # means id.

Rob

Breakfast: the most important donut of the day.

11 Aug 2007, 2:07 AM
#5
busymom avatar

busymom

New Zenner

Join Date:
Jul 2007
Posts:
61
Plugin Contributions:
0

Re: CSS to eliminate dotted box click in Firefox

Thanks, Rob -- time to pull out my CSS and HTML books and look up submit "thing"! :laugh: Truly, since I don't know anything about forms and input, putting a blanket

submit { outline: none; }
was actually the first thing I tried. It didn't help, so I really just assumed I was off base on the guess! The stuff I've found on the web all showed things like adding it to a "button.submit:active" and "button.submit:active span" or in the input statement itself. I tried hardcoding it into the input statement in the html_output.php file, but either I did it wrong or I was in the wrong input statement. I thought this kind of button is the submit type, but I might be wrong.

I'll need to pull out the reference books and spend some more time with the Firefox web tools to see if I can't figure out a way to get it right. I sure do hate losing the time for something stupid like this when I could be formatting my categories!!

If anyone has figured out how to do it, I sure could use the help!
TIA Karen

14 Aug 2007, 2:25 AM
#6
busymom avatar

busymom

New Zenner

Join Date:
Jul 2007
Posts:
61
Plugin Contributions:
0

Re: CSS to eliminate dotted box click in Firefox

This actually turned out to be a problem I wasn't able to solve with CSS and the reason my previous attempt at hardcoding it in html_output.php is that I had the right solution in the wrong place. Without investigating why, I've discovered that the css_buttons.php code was actually controlling these input buttons, not the html_output.php as I originally thought. I decided to do a brute force change to capture all the different kinds of situations that might occur. Anyone who decides to try to fix this "problem" should be forewarned that the outline box I was trying to remove is a result of "focus" on the input button and that removing it will render it basically useless to visually impaired customers using things like screenreaders because the focus is gone. For those of you who are willing to proceed with removing the focus, this is how I solved the problem:

In the file installed for the CSS Buttons mod, I made the following addition to includes/functions/extra_functions/css_buttons.php:

if (strpos($parameters, 'class="') === FALSE){
// only add class if no class is passed through $parameters
$class = ' class="' . $mouse_out_class . '" ' . $css_button_js;
}
// 08/13/07 Add onfocus="this.blur();" to eliminate dotted
// outline when button is in focus
$class .= 'onfocus="this.blur()"';

It would actually have been more appropriate to add the extra code to the $css_button_js variable instead, but I didn't know enough about the code to determine if it was safe to bypass those IF blocks. In this case, it looked clean enough to just tack it on to the end without any side effects no matter what the souce of the $class setting was.

I have NOT done any testing with IE or Opera. I have only observed that this gets rid of my dreaded box in Firefox for all the buttons I've been able to test so far. Keep in mind that since functions aren't available as overrides, this will be a problem everytime you upgrade your code, but then again, so will the entire CSS Buttons mod!

HTH Karen

14 Aug 2007, 1:46 PM
#8
busymom avatar

busymom

New Zenner

Join Date:
Jul 2007
Posts:
61
Plugin Contributions:
0

Re: CSS to eliminate dotted box click in Firefox

Yes, Misty, I'm pretty sure that it was the latest since I just did it in the last week or so. I'm on a different computer right now, so I can't verify it, but I'm nearly positive. Since I read through the entire support thread before installing the Mod, I was aware of that latest update before doing the install. I'll check later when I get a chance and if it wasn't the latest, I'll post back.

The problem isn't with the Mod itself. The mod SHOULD be doing what it was doing in keeping the focus since that makes the code the most adaptable, but I just couldn't stand that focus outline and couldn't find a CSS method that would get rid of it for me. It might have something to do with the fact that I use a background image and followed instructions in the CSS Buttons support thread to help get rid of the background image getting lost problem, but I couldn't make an "input:focus {outline: none; }" in the CSS work for me.

Thanks, Karen

30 Sep 2007, 6:58 PM
#9
oma avatar

oma

New Zenner

Join Date:
Feb 2006
Location:
Seattle.WA
Posts:
14
Plugin Contributions:
0

Re: CSS to eliminate dotted box click in Firefox

I stumbled onto this thread while looking for help on css buttons. The dotted box in Firefox was bugging me also. I did a google search on "css" and "focus" which led me to a solution that worked for me. I added the following to my main css stylesheet after the initial references to a links:

a:focus {outline: none;}

It seems to have removed the dotted box when viewing my site in Firefox, and doesn't seem to affect my site while using Internet Explorer.

j. becker
the oma project
http://omaproject.com

30 Nov 2008, 6:05 AM
#10
alphasigns avatar

alphasigns

New Zenner

Join Date:
Nov 2008
Posts:
1
Plugin Contributions:
0

Re: CSS to eliminate dotted box click in Firefox

You've got to get the HTML / XHTML to read the button focus. You need to get it our of the php or css (whichever your issue.)

I added it as part of my links via css. You need to alter your code so the clickity of the submit button will know to blur on focus

onFocus="this.blur()";

PHP is only going to complicate your issue. Hope this helps and you can find your solution.

3 Dec 2008, 7:44 PM
#11
extence avatar

extence

New Zenner

Join Date:
Oct 2007
Posts:
3
Plugin Contributions:
0

Re: CSS to eliminate dotted box click in Firefox

This also works:

:focus
{
-moz-outline-style: none;
}