Can I run a CSS file in the code editor?

This article explains why CSS files can not run on their own and explains how teachers can view student's CSS files from the Educator Portal.

Last updated - July 22, 2024

We teach and encourage students to use stand-alone “.css” files to organize their styles for their web pages. CSS stands for “cascading style sheet” CSS is used in conjunction with HTML to apply styles and layout rules to HTML elements. For this reason, students are not able to run CSS files from the code editor--attempting to do this will produce an error message.

 

However, our team has created a fix that does allow teachers to view CSS through the Educator Portal by attaching the CSS file to a blank HTML file. Please keep in mind that not all CSS will return feedback; only CSS that provides background images and colors will show. To view a preview of a student's CSS file you will need to log in to your Educator Portal, go to the Student Progress section, choose a student, click View code, and click on file preview. This will allow you to view certain aspects of the student's CSS; only CSS that provides background images and colors will show. Keep in mind that CSS can only run "by itself," in this section of the Educator Portal, and not in the code editor section for students--trying to view CSS in that section will produce a "cannot run CSS file," error message, which is correct. Usually, it is not possible to run a CSS file because CSS is used to add styling to HTML. If an HTML file is not attached to CSS, it can not run. 

 

It is not possible to run a CSS file because CSS is used to add styling to HTML. If an HTML file is not attached to CSS, it can not run.