2

I once read you could force the color of visited links in Safari by adding a:visited { color: #6611cc !important; } in the .css file under Preferences < Advanced. In this way, it will turn every link you've clicked on purple and by so override the actual web design.

I like the idea but I tried to do so, but TextEdit or Word won't allow me to save the file. It wants to add .rtf, .webdesign or other extensions behind the .css.
How can I force to add this to the .css file?

1
  • 1
    I know this doesn’t directly answer your question, but if you’re familiar with the command line, you could use nano, ed or vi to edit and save the file. These binaries are all bundled with OS X. Commented Apr 30, 2012 at 7:46

4 Answers 4

3

First, use TextEdit, don't use Word.

Before you save your document, select Make Plain Text from the Format menu. (If the menu says Make Rich Text then you are already in plain text mode.)

If you save the document now, you should be able to give it whatever extension you want. Since the file is plain text, you can be sure that TextEdit won't add any additional formatting instructions that will turn it into an incorrectly-formatted CSS file.

3

Although it doesn't directly answer your question, personally, I would use something like Textwrangler (free) instead, which is much better suited for jobs like this.

A general-purpose text editor for light-duty composition, data-file editing (where the data files consist of plain [unstyled] text), and manipulation of text-oriented data.

You won't run into any of the issues you described (including the fact that rtf is formatted text and what you want is plain text - although you can switch to plain text in TextEdit) and you can name the file whatever you wish. You'll also get syntax highlighting which helps too.

enter image description here

0
0

Save the file then select the file in the Finder. With the file selected in Finder, Choose Get Info (Command - I).

In the Name & Extenstion section, rename the file to visited.css. It will likely as if you want to change the extension from something like .rft to .css, click OK and your done. Move the file to wherever you want and select it from within Safari.

2
  • 2
    If the file was saved with an RTF extension, it probably contains RTF formatting codes, and therefore wouldn't work properly as a CSS file, even if you rename it.
    – benzado
    Commented Apr 30, 2012 at 8:09
  • In TextEdit you should be able to save it as type text (.txt). There shouldn't be any formatting codes in that. Delete any that you find. If you need a free code editor try Text Wrangler from the makers of BBEdit. You can get it from the app store.
    – afragen
    Commented Apr 30, 2012 at 20:30
-1

Just found this while searching for an answer myself - not sure if it's any help now - 4 yrs later But you need to go to 'get info' on the text file And then remove ".txt" from the name & extention Done!

1
  • No because the file will have formatting info in it as well as the text
    – mmmmmm
    Commented May 24, 2016 at 12:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .