This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
ideas:current-url-selector [2007/10/29 08:03] – created fantasai | ideas:current-url-selector [2014/12/09 15:48] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Current URL Selector ====== | ====== Current URL Selector ====== | ||
- | Insert description | + | |
+ | ===== Need ===== | ||
+ | |||
+ | Current CSS standards allow for the independent styling of links based on the client history using the visited link pseudo-class. This allows designers to indicate which links the visitor has been to previously. However, visitors need to not only know where they have been, but where they are and where they are going as well. Web designers need a way to conveniently style a link based on the clients current URI in order to create more useful menus and bread-crumb trails as well as indicate whether a link is pointing out of the current site. | ||
+ | |||
+ | |||
+ | ===== Solution ===== | ||
+ | |||
+ | In order style links based on the users current location within a site and to differentiate internal versus external links, I propose the addition of a new “current” link pseudo-class. This pseudo-class would not only be used to style a link if it's href matched the clients current URI, but also style links based on directory level. | ||
+ | |||
+ | The current link pseudo-class selector would have the following pattern: | ||
+ | E: | ||
+ | |||
+ | Matches element '' | ||
+ | |||
+ | So, given the links: | ||
+ | |||
+ | - ''< | ||
+ | - ''< | ||
+ | - ''< | ||
+ | |||
+ | and the styles | ||
+ | |||
+ | |||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | |||
+ | If the client' | ||
+ | |||
+ | - Link 1 would receive style 2 | ||
+ | - Link 2 would receive style 3 | ||
+ | - Link 3 would receive style 1 and 3 | ||
+ | - Style 4 would //not// be applied | ||
+ | |||
+ | |||
+ | ===== Use Cases ===== | ||
+ | |||
+ | ; Site Navigation Menus : Site menus could be consistently styled based on the visitor' | ||
+ | ; Bread-crumb menus : Levels in a bread-crumb trail can be displayed based on the current page URI, eliminating the need to use server-side technology, JavaScript, or create separate instance for every page within the site. | ||
+ | ; Internal/ | ||