8 replies [Last post]
rbfree
Offline
Enthusiast
Last seen: 5 years 6 weeks ago
Timezone: GMT-7
Joined: 2007-12-19
Posts: 124
Points: 0

Does a CSS/xhtml method exist for creating a link that will return the user to the previous page viewed (i.e., linked from). For instance, I have a page called "Explanatory Notes," which is actually a menu of links to each of a few pages each called "Explanatory Note: Some subject matter," or "Explanatory Note: Some other subject matter," etc.

Other pages might also link to any of these notes. For example, I might include a link from a glossary list item to an explanatory note.

I would like to create a link within each of these explanatory notes that would link the user back to the page read before linking over to the Explanatory note. So, it's sort of a "Go back to the page from where you came" button.

If there is a CSS method, what key word should I be looking for. (What is this tactic called?) (I've tried several key word searches with terms that intuitively seemed correct, but no luck.)

If the solution is not in CSS, can someone give a hint as to where I should look next?

Thanks!!

CSS n00b

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 11 hours 6 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9149
Points: 3133

Sounds like you're

Sounds like you're describing the "back" button. But, whatever it is, it's not in CSS. Smile

The <link /> element offers the potential, in theory. I don't know of any browser today that does what you're wanting out of the box. I think the old Mosaic browser, and Mozilla pre 1.0 (it was removed in late beta) created a panel with the links available.

The <link /> element is meant for the browser's use. Some browsers, I've heard, use the info to preload pages based on the element's rel attribute.

Firefox does have an extension, site navigation bar, which does what Mosaic and Mozilla<1.0 did.

The back button is still the winner; people know how it works.

cheers,

gary

Unplanned code results in a tangled wad of brain-cramping confusion.

There are enough html & css demos and tutorials to be interesting. Please visit.

rbfree
Offline
Enthusiast
Last seen: 5 years 6 weeks ago
Timezone: GMT-7
Joined: 2007-12-19
Posts: 124
Points: 0

Yes, no to the back button

Yes, it seems I would have to use a script for such behavior, and I have the script (though I would need to go through carefully to "get it").

But, I'm rethinking the back button strategy, given the browser button seems to work quite well, anyway. I was contemplating a convenience for the irritated user at the end of a bad day, so to speak. But, my site is fairly straightforward with lots of signposts, so it shouldn't invoke too much road rage. (Not to imply that it's yet on-line.)

Thanks for the comments and links.

CSS n00b

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 28 weeks 2 days ago
London
Joined: 2004-06-06
Posts: 15650
Points: 2788

The back button exists for a

The back button exists for a reason and it's reason is just as you have described. Don't try and re-invent the wheel, users must learn to use their tools, the back button works and works well let the user deal with this aspect of things. As it goes though, the back button is one of the few 'controls' that most users seem universally familiar with.

If you really must provide something, what used to be used was the javascript 'history' function.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 11 hours 6 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9149
Points: 3133

As Hugo sz, there is js's

As Hugo sz, there is js's history. How will you know programmatically how far to back up?

A better plan is to use meaningful title content, which is what shows up in the back button's history dropdown.

For an abbreviated example, go to my site, http://gtwebdev.com/ and follow menu links to the team and the résumé, then move to the workshop, floats, and enclosing floats. Now look at the back button's drop-down history. With good titles, backing up is easy.

cheers,

gary

Unplanned code results in a tangled wad of brain-cramping confusion.

There are enough html & css demos and tutorials to be interesting. Please visit.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 28 weeks 2 days ago
London
Joined: 2004-06-06
Posts: 15650
Points: 2788

Quote: How will you know

Quote:

How will you know programmatically how far to back up?

If I remember correctly it's simply (-1) back to previous page.

As Gary points out though it's more about careful and considered directory structure and naming convention to provide a meaningful trail, and a trail is perhaps a good idea to consider, it's not a back button but provides a simple view of the path to the present file allowing backward traversing. Of course the majority of breadcrumbs tend to be just that, a path to file rather than a route taken by user to that file, but even so I like a clear crumb trail that shows the path especially if the site structure has been thought through as that will generally take you back logically through the pages.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 11 hours 6 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9149
Points: 3133

I was thinking for a

I was thinking for a multi-stage return. You're on pageA, click to pageB as is our wont on the interweb, see the FAQ and go to Q3. Now our history is
FAQ
pageB
PageA
and we want to return to pageA. Or, is it pageB? Do we want history -1, -2 or -3? Neither breadcrumbs, as normally implemented[1], nor javascript handle that well. Good page titles and your history work, thus the back button.

cheers,

gary

[1] Could javascript use the history to construct a "where we've been" trail of breadcrumbs? How would that be different/better than using the back button's history?

Unplanned code results in a tangled wad of brain-cramping confusion.

There are enough html & css demos and tutorials to be interesting. Please visit.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 28 weeks 2 days ago
London
Joined: 2004-06-06
Posts: 15650
Points: 2788

rhetoric question or not. No

rhetoric question or not.
No I don't think the history function (is it a function?) can do that it's not a populated array as such , if you could your site would display the users browser history from your site and all the other sites they had visited, rather a privacy issue.

The javascript history function is the browser back button it simply acts on the browsers history.

Anyways it's all academic the back button is there for a reason, we do not need to provide this functionality within a web sites rendered pages, although I do like me breadcrumbs Smile

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

rbfree
Offline
Enthusiast
Last seen: 5 years 6 weeks ago
Timezone: GMT-7
Joined: 2007-12-19
Posts: 124
Points: 0

"Anyways it's all academic

"Anyways it's all academic the back button is there for a reason, we do not need to provide this functionality within a web sites rendered pages, although I do like me breadcrumbs ["meaningful title content, which is what shows up in the back button's history dropdown"].

As a n00b, I'm settling in to this reasoning, for now, at least. As noted, the browser back button provides plenty of functionality.

And, it seems that the benefits of meaningful title content sort of parallel the benefits of meaningful mark-up (xhtml). Both labors provide a basis for understanding available to the 2nd person (for trouble-shooting or back-navigating.) So far, I've been careful when naming my documents.

However, I did discover an important lesson last night: title your docs as you go. In my case, I used a xhtml template that I created to form new documents but neglected (and then forgot) to re-title them as I went along. So, last night I wasted time reviewing each document to assure that it had a unique and meaningful title. My purpose was to provide meaning to readers of search results, but upon reading these posts, I see that providing a history trail is equally important.

Thanks again. Aside from some content on a few remaining pages, my site is almost ready to go up.

CSS n00b