Please note that you may have been redirected (you might like to make a note of the URL in the address bar of your browser and update accordingly) This is a permanent archvie but is no longer actively maintained. Please visit http://joshuaink.com for the latest updates.
CSS flags and find using selection
Thursday May 12, 2005
Doug Bowman's post about flags within a CSS file (you may need to read it to make sense of this post) was exceptionally timely. Further to the advantages of flagging, I need to hand the file over to another person, for them to work with, and I wanted to make it as easy as possible for said person to find sections.
I have being doing a contents comment at the top of my CSS for a while now but combined with flags and the find using selection command, I have had a bit of a revelation.
So to cover it briefly, first set up the contents comment thus:
- /*NOTES ---------------------------------
- Insert notes here
- UPDATE INFO ------------------------
- Revision number: 0.7
- Last updated: 12 May 2005
- Last update made by: john oxton (john@joshuaink.com)
- CONTENTS ---------------------------
- =1: Universal reset
- =Reset margin and padding for all elements
- ---------------------
- =2: html and body
- ---------------------
- =3: General typography
- =Set default padding and margins
- =p
- =hx
- =dl
- =ul
- =ol
- =li
- =a
- ---------------------------
- =3a: General params
- =img
- ---------------------
- =4: Layout Divs
- =Page header logo
- =Hidden accessibility elements
- ... you get the idea
- --------------------- */
And then for each section, put a flag comment that corresponds exactly to the one found in the content comment, for example:
- /* =3: General typography */
- /* =Set default padding and margins */
- h1,h2,h3,h4,p,address,ul,ol{
- margin:1.3em 0;
- }
With this done you can now open the file in you favourite editor, highlight/select the flag you want to jump to within the content comment at the top of the page, this done, select Find Using Selection (Shift + F3 Dreamweaver) and you will be taken straight to the section, a bit like page anchors I guess.
Update
In Dreaweaver PC at least, pressing CTRL + Home will take you straight back up to the top of the page.
I am not sure what the Find Selection shortcuts are for each editor, but if you try this out at home (check with the adult responsible for your CSS first!) leave the name of your editor and the shortcut here in the comments.
If you want a ready made example to play with it can be downloaded here.
Now, back to work before the boss notices I am blogging at work!




Philroche
1766 days ago
Graham Bancroft
1766 days ago
Jaakko
1766 days ago
Anton
1766 days ago
Remi Prevost
1766 days ago
Sebastian Schmieg
1766 days ago
Jolo
1765 days ago
Ian
1765 days ago
Julian
1765 days ago
Julian
1765 days ago
Raedan
1765 days ago
John Oxton
1765 days ago
Andy Hume
1765 days ago
Ian
1765 days ago
Chris J. Davis
1765 days ago
Veracon
1765 days ago
Mike Stenhouse
1765 days ago
Nathan Smith
1763 days ago
Neil
1763 days ago
Stefan Isarie
1762 days ago