close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

hover state positioning...

Thread began 3/01/2013 6:30 am by JamieEff | Last modified 3/01/2013 10:13 am by JamieEff | 953 views | 5 replies |

JamieEff

hover state positioning...

Hey guys

Just wondering how i would get the hover state word to be positioned above the arrow in the attached screenshot

Heres the css i have :

ul#cssmw {  cursor: default;  list-style-type: none;  margin: 0 0 0 2px;  padding: 0 0 0 0;}
ul#cssmw ul { cursor: default; list-style-type: none; margin: 0 0 0 0; padding: 0 0 0 0;}
ul#cssmw ul li { background-image: none; float: none;}
ul#cssmw li { background-image: none; float: left; padding: 0 0 0 0; position: relative; white-space: nowrap; z-index: 100;}
ul#cssmw li ul { display: none; top: 0;}
ul#cssmw li:hover > ul { display: block; position: absolute;}
ul#cssmw li.hover > ul { display: block; position: absolute;}
ul#cssmw li.current > ul { position: absolute;}
ul#cssmw > li { background-image: none;}
ul#cssmw > li > a, ul#cssmw > li > a:link { background-color: #5d5e61; background-image: none; border-style: none; color: #FFFFFF; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; height: 25px; padding: 120px 0px 0px 0px; text-align: center; text-decoration: none; text-transform: uppercase; width: 93px; outline-style: none;}
ul#cssmw > li > a:active, ul#cssmw > li > a:focus { background-color: #FF00FF; background-image: url("../images/misc/nav-arrow.png"); background-position: center 123px; background-repeat: no-repeat; color: #FFFFFF; font-weight: normal; text-decoration: none; outline-style: none;}
ul#cssmw > li:hover > a, ul#cssmw > li:hover > a:link { background-color: #FF00FF; background-image: url("../images/misc/nav-arrow.png"); background-position: center 123px; background-repeat: no-repeat; color: #FFFFFF; font-weight: normal; text-decoration: none; outline-style: none;}
ul#cssmw > li.current > a.current, ul#cssmw > li.current > a.current:link { background-color: #FF00FF; background-image: url("../images/misc/nav-arrow.png"); background-position: center 92%; background-repeat: no-repeat; color: #FFFFFF; font-weight: normal; text-decoration: none; outline-style: none;}



thanks in advance

Jamie

Sign in to reply to this post

JamieEff

there is probably a better way of doing this but have worked one way out by changing the hover css from this

html:
ul#cssmw > li:hover > a, ul#cssmw > li:hover > a:link {  background-color: #FF00FF;  background-image: url("../images/misc/nav-arrow.png");  background-position: center 123px;  background-repeat: no-repeat;  color: #FFFFFF;  font-weight: normal;  text-decoration: none;  outline-style: none;}



to this

html:
ul#cssmw > li:hover > a, ul#cssmw > li:hover > a:link {background-color: #FF00FF;  background-image: url("../images/misc/nav-arrow.png");  background-position: center 138px;  background-repeat: no-repeat;  color: #FFFFFF;  font-weight: normal;  text-decoration: none;  outline-style: none; padding-bottom:15px;margin-top:-15px;overflow:hidden;}



is there a better way to achieve this?

Sign in to reply to this post

Jason ByrnesWebAssist

That looks like it should do the trick.

Sign in to reply to this post

JamieEff

thanks Jason

I also need to make the hover/focus and active colours differnt for each navigation point but am unsure as to how I would structure the naming of the css elements and then how to id or class the on page elements.

Thi sis the one colour fits all css at the moment:

html:
ul#cssmw > li > a, ul#cssmw > li > a:link {  background-color: #5d5e61;  background-image: none;  border-left: 2px solid #fff;  color: #FFFFFF;  display: block;  font-family: Arial, Helvetica, sans-serif;  font-size: 14px;  font-style: normal;  font-weight: normal;  height: 25px;  padding: 120px 0px 0px 0px;  text-align: center;  text-decoration: none;  text-transform: uppercase;  width: 91px;  outline-style: none;}
ul#cssmw > li > a:active, ul#cssmw > li > a:focus { background-color: #ff426b; background-image: url("../images/misc/nav-arrow.png"); background-position: center 143px; background-repeat: no-repeat; color: #FFFFFF; font-weight: normal; text-decoration: none; outline-style: none;padding-bottom:20px;margin-top:-20px;overflow:hidden;}
ul#cssmw > li:hover > a, ul#cssmw > li:hover > a:link {background-color: #ff426b; background-image: url("../images/misc/nav-arrow.png"); background-position: center 143px; background-repeat: no-repeat; color: #FFFFFF; font-weight: normal; text-decoration: none; outline-style: none; padding-bottom:20px;margin-top:-20px;overflow:hidden;}
ul#cssmw > li.current > a.current, ul#cssmw > li.current > a.current:link { background-color: #ff426b; background-image: url("../images/misc/nav-arrow.png"); background-position: center 143px; background-repeat: no-repeat; color: #FFFFFF; font-weight: normal; text-decoration: none; outline-style: none;padding-bottom:20px;margin-top:-20px;overflow:hidden;}



and this is the navigation set:

html:
<ul class="level-0" id="cssmw">
<li class="parent"><a href="index.php">home</a></li>
<li><a href="books.php">books</a></li>
<li><a href="marketing.php">marketing</a></li>
<li><a href="websites.php">websites</a></li>
<li><a href="about.php">about</a></li>
<li><a href="contact.php">contact</a></li>
</ul>



any steerage in getting this would be gratefully received.

Thanks

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

add a unique ID to each element:

<li id="books"><a href="books.php">books</a></li>


then add the id selector to the css rule, for example:

ul#cssmw > li#books > a, ul#cssmw > li#books > a:link

Sign in to reply to this post

JamieEff

thats spot on and many thanks

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...