October 15, 200818 yr Hi guys, I'm building a web site for a client who insists on using a specific font for navigation purposes and he wants it to change colour when users have visited the link. The font would not necessarily be installed on a viewers PC and I'm stumped. I could make each link a .gif on a transparent background but it won't change colour once visited. I thought about having two .gifs for each link (one black, one grey) but don't know how to make it work. I don't understand CSS and are using a package to design the web side as opposed to writing it all out long hand in HTML. Does anyone know if there is a way to get over this problem? Many thanks in anticipation
October 15, 200818 yr The popular "sliding doors" technique will do it nicely. You would still need a graphic for each link, but you would combine each 'state' so it's all in one image, so it only needs to be downloaded once. Essentially what happens is that you use the graphic as a background for an element with a fixed width and height, and move the position of the background image depending on the state. For instance, you could have your graphic split into four, with the 'normal' state in the top left of the image, 'hover' in top right, 'visited' in bottom left, and 'active' (i.e. being clicked) in bottom right. Then you would use some CSS a bit like this: .menuitem {background: url(menuitem.gif) top left no-repeat; width: 100px; height: 40px;} .menuitem:hover {background-position: top right;} .menuitem:visited {background-position: bottom left;} .menuitem:active {background-position: bottom right;} Hope that helps! If not, I'm sure I did a tutorial on this once, I'll see if I can dig it out...
October 16, 200818 yr Author Many thanks for the reply Matthew - much appreciated. I think I understand what you are saying but I don't think I know how to achieve this. I've never used CSS so it might mean a trip to the bookstore to look for a copy of "An Idiots Guide to CSS" I design 4 or 5 web sites and have always used a package so I've never learnt hot to manually program in HTML or CSS. If you could find your tutorial I think it would help enormously. Kind regards Baz
October 16, 200818 yr Author I found THIS which would appear to be exactly what I need but I can't see where I get the code from?
October 16, 200818 yr Hi if you are looking for a book to buy and don't want to spend a lot of money, try css mastery. http://www.cssmastery.com/ Shop around though as i am sure you'll pick it up for almost next to nothing. It teaches you the menu structures using unordered lists, the hover, active and visited techniques... Also, this link may help you out CSS HERE
October 17, 200818 yr Author Hi if you are looking for a book to buy and don't want to spend a lot of money, try css mastery. http://www.cssmastery.com/ Shop around though as i am sure you'll pick it up for almost next to nothing. It teaches you the menu structures using unordered lists, the hover, active and visited techniques... Also, this link may help you out CSS HERE That should be a great help. Thank you.
Create an account or sign in to comment