.css opens only in firefox

Hi, I'm trying to learn basic coding, and my .css opens a new window in Firefox (the .html file opens in Safari, correctly) and doesn't fix the style of my .html file.


How do I fix this?

MacBook Pro, macOS Sierra (10.12.6), Firefox installed

Posted on Oct 21, 2018 6:54 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 21, 2018 8:49 AM

You can link that external .css file into your HTML document, or even embed it within the HTML head section's style block, or individually style HTML elements with CSS. See this article for more on these variations.


Double-clicking on an HTML file will open it in the default browser, and if you have managed the associated CSS via any of the above choices, the HTML will appear styled. Right-clicking on it, and choosing a different Open With browser is also possible. You do not double-click a .css file.

2 replies
Question marked as Top-ranking reply

Oct 21, 2018 8:49 AM in response to L1mom

You can link that external .css file into your HTML document, or even embed it within the HTML head section's style block, or individually style HTML elements with CSS. See this article for more on these variations.


Double-clicking on an HTML file will open it in the default browser, and if you have managed the associated CSS via any of the above choices, the HTML will appear styled. Right-clicking on it, and choosing a different Open With browser is also possible. You do not double-click a .css file.

Oct 21, 2018 9:18 AM in response to L1mom

If you are needing the .css file to open with your code editor... Select the file icon in the Finder and do a CMD-I (or under the File menu select Get Info). Then in the info window look for the section "Open with:". There you can select which application you want the file to be opened by in the future using the pulldown menu. And if you want all files with a .css extension to be opened by the same application click the "Change All..." button.


If you originally created the file by doing a File > Save Page As... in Firefox, or if you clicked Save next to the filename in the Developer Tools Styles Editor (or something similar) then Firefox might have set itself as the preferred app to open the .css file.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

.css opens only in firefox

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.