https://github.com/css-tricks/view-source-button
Using jQuery, Code Prettify, and CSS3 :target, we can make a button that pops up a nice looking view of the current pages source code.
https://github.com/css-tricks/view-source-button
Last synced: 11 months ago
JSON representation
Using jQuery, Code Prettify, and CSS3 :target, we can make a button that pops up a nice looking view of the current pages source code.
- Host: GitHub
- URL: https://github.com/css-tricks/view-source-button
- Owner: CSS-Tricks
- Created: 2012-08-07T17:13:44.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2012-08-07T17:20:17.000Z (almost 14 years ago)
- Last Synced: 2025-04-04T15:40:14.545Z (about 1 year ago)
- Language: JavaScript
- Size: 142 KB
- Stars: 10
- Watchers: 8
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.markdown
Awesome Lists containing this project
README
# View-Source-Button ([Article](http://css-tricks.com/make-a-view-source-button/) / [Demo](http://css-tricks.com/examples/ViewSourceButton/))
The idea that first came to mind was to use CSS3's :target pseudo class. We talked about these a while back while exporting CSS3 tabs. The idea is to have a link that links to the #source-code hash tag. That puts #source-code at the end of the URL, and allows the :target selector to match and apply styling.