css hover effect error

This is a discussion on "css hover effect error" within the Web Page Design section. This forum, and the thread "css hover effect error are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Oct 12th, 2007, 14:56
New Member
Join Date: Oct 2007
Location: bahrain
Age: 29
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
css hover effect error

HTML: Select all
<style type=text/css>

ul.itemmenu{
    padding:            0;
    margin:                0;

    list-style:            none;                /*remove the bullets points*/
    background-color:     #FFFFFF;            /*make container background color white*/
    width:                200px;                /*set list container to fix width*/
    border:                1px solid;            /*make container border visible*/

    font-family:        tahoma;
    font-size:             0.8em;
    
    text-align:            center;                /*makes menu align horizontally*/            
}

/*apply exclusive hyperlink list formatting to the itemmenu class.
any hyperlink declared outside the itemmenu class
will render unformatted*/

ul.itemmenu li a{
    text-decoration:    none;                /*remove hyperlink underline formatting*/
    display:            block;                /*make list clickable in any list portion*/
    width:                180px;                /*set the display block width*/
    /*padding:            2px 10px;*/
    /*float:left;*/
}

ul.itemmenu li a:hover{
    background-color:    #B9BB79;            /*change hovered list background color to emphasize*/
    border:                1px dotted;            /*and set its border to dotted lines*/
    }

ul.itemmenu li a:active{
    font-weight:        bold;                /*make the selected link bold*/
}

</style>
how can i make the hover effect in Ff the same as in IE



Last edited by karinne; Oct 12th, 2007 at 15:07. Reason: Please use the proper vBcode when inserting code in your post.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Oct 12th, 2007, 15:09
Highly Reputable Member
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Re: css hover effect error

Both IE and Firefox display things defferently

Your could try using dashed instead of dotted and see if that makes any difference and create a conditional IF so firefox uses dashed and IE uses dotted (if you know whjat i mean)

Last edited by AdRock; Oct 12th, 2007 at 15:11.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 12th, 2007, 15:16
New Member
Join Date: Oct 2007
Location: bahrain
Age: 29
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: css hover effect error

AdRock: i tried using dashed but im having the same hover effect in FF where block hover effect is located in the left most side while on IE it is center. i want both of them to be centered. for the IF condtion i will really look unto it but if you have sample that will be even great.

THANKS!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 13th, 2007, 01:26
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: css hover effect error

I'm no genius when it comes to navigation but I'm curious about this in red.
Code: Select all
ul.itemmenu li a{
    text-decoration:   none;        /*remove hyperlink underline formatting*/
    display:           block;       /*make list clickable in any list portion*/
    width:             180px;     /*set the display block width*/
    /*padding:         2px 10px;*/
    /*float:left;*/
}
Did you comment that out?
I think the float: left is still being read by FF.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 13th, 2007, 09:32
Highly Reputable Member
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Re: css hover effect error

Quote:
Originally Posted by jlbantang View Post
AdRock: i tried using dashed but im having the same hover effect in FF where block hover effect is located in the left most side while on IE it is center. i want both of them to be centered. for the IF condtion i will really look unto it but if you have sample that will be even great.

THANKS!
Here is a thread i started that might be of use http://www.webforumz.com/css-forum/6...stylesheet.htm

Why don't you delete these lines that you have in red that Lchad pointed out and see if that solves your problem with the centering

If not have a look at what i did with my navigation. My nav is in a div so i haven't set a width but look at the padding. The 5px on the end is the padding on the left so it's really indenting the link. You may have to do something like that...say about 30px or something.

Code: Select all
 
ul#menu li a, .menu2 li a {
   display:block;
   background-color: #F9DBD9;
   color: #000000;
   text-decoration: none;
   outline: none;
   padding: 0px 0px 1px 5px;
}
ul#menu li a:hover, .menu2 li a:hover {
   display:block;
   background-color: #D6DDE6;
   color: #000000;
   text-decoration: none;
   outline: none;
   padding: 0px 0px 1px 5px;
}
Just looking at the difference between borders in IE and FF and they both render differently for the dotted border but not the dashed border, so if you want to use a dotted border you may have to except that there is going to be a difference unless you specify a thickness of 1px by doing border: 1px dotted #000;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 13th, 2007, 09:33
Jack Franklin's Avatar
Moderator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,408
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Re: css hover effect error

I'll see what I can do but can I see the html? Is it just a normal ul list?

edit: GOT IT!! I just fiddled with the width and text-align and it works in IE & FF!

Code: Select all
<ul class="itemmenu">
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
Code: Select all
ul.itemmenu{
    padding:            0;
    margin:                0;
    list-style:            none;                /*remove the bullets points*/
    background-color:     #FFFFFF;            /*make container background color white*/
    width:                200px;                /*set list container to fix width*/
    border:                1px solid;            /*make container border visible*/
    font-family:        tahoma;
    font-size:             0.8em;
    
    text-align:            center;                /*makes menu align horizontally*/            
}
/*apply exclusive hyperlink list formatting to the itemmenu class.
any hyperlink declared outside the itemmenu class
will render unformatted*/
ul.itemmenu li a{
    text-decoration:    none;                /*remove hyperlink underline formatting*/
    display:            block;                /*make list clickable in any list portion*/
    width:                80%;                /*set the display block width*/
 text-align: center;
 margin: 0 auto;
}
ul.itemmenu li a:hover{
    background-color:    #B9BB79;            /*change hovered list background color to emphasize*/
    border:                1px dotted;            /*and set its border to dotted lines*/
 width: 80%;
 text-align: center;
 margin: 0 auto;
    }
ul.itemmenu li a:active{
    font-weight:        bold;                /*make the selected link bold*/
}
I've changed the bits in red.

I've uploaded an example as well:
http://www.jackfranklin.co.uk/jlbantang/navigation.html

Cheers!

Jack
__________________
Jack Franklin - Webforumz Moderator
(x)HTML | CSS | PHP | MySQL | JQuery (Javascript)
Contact: My Blog | Twitter | Delicious
Want Lessons? PM me.
If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)

Last edited by Jack Franklin; Oct 13th, 2007 at 09:40.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 13th, 2007, 12:30
New Member
Join Date: Oct 2007
Location: bahrain
Age: 29
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: css hover effect error

perfect!!!

thanks a lot!

i should be reading more.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
open_basedir restriction in effect error in PHP BenR41 PHP Forum 0 Feb 25th, 2008 12:20
Hover effect for sub menus ? Oak Web Page Design 28 Feb 22nd, 2008 23:40
CSS Hover Effect In IE Monie Web Page Design 6 Feb 12th, 2008 00:43
Keep getting error message Microsoft VBScript runtime error '800a01a8' cpando1974 Classic ASP 2 Aug 7th, 2007 12:00


All times are GMT. The time now is 11:08.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42