moodle how to css for text in course pages

by Gwendolyn O'Kon 4 min read

Try the following. Go to Site administration - Appearance - Themes - Moove - Advanced settings Then paste your CSS into the _Raw SCSS_ box.

Part of a video titled How to ADD CSS STYLES to a MOODLE COURSE when you ...
2:02
10:42
And selecting configure HTML block. And you'll get used to doing this quite a bit as you makeMoreAnd selecting configure HTML block. And you'll get used to doing this quite a bit as you make changes to your CSS. We click on the drop down arrow.

Full Answer

How to add CSS stylesheets to Moodle?

Apr 09, 2009 · It is certainly possible to use CSS everywhere in your Moodle courses, on top of the current visual theme. 1- When you say "course HTML pages" do you mean: a) HTLM pages created on your local machine with an HTML editor and uploaded to your course files (this is by far my preferred method); in that case you just use inline CSS or an external CSS file just as …

How do I add CSS to a course page?

Apr 25, 2011 · You can add CSS in Topic 0 of your course page. If you know how to write CSS, you should have no problem. Just make sure you click on the HTML tab before you begin to add your CSS mark-up. You need to astart and end it with the following tags... HTH. Mary

How many CSS files should I have for my Moodle styles?

How Do I Use Css In Moodle? You can use Moodle 2 in general. Add a style file called’styles’ to your system. Adding CSS ‘to your main file within the plugin can get it to behave better. The original Moodle content is based on a version called 0.9. A …

How to add/override “custom SCSS/CSS” from Moodle in boost theme?

This course is designed to teach you how to create responsive content in your Moodle course. It will deal primarily with HTML and CSS in course pages as well as using a plugin called Generico. The course includes how to: - Create a course - Create a navigation structure - Import content from Word or Google Docs - Clean HTML - Use Font Awesome

How do I use CSS in Moodle?

In Moodle 2.0, add a file called 'styles. css' into the main folder of the plugin with all your CSS in it. (For Moodle 1.9 it is called 'styles. php' and doesn't work for most sub-plugins, so you need to use nasty javascript hacks to load the style sheet at a later date).

How do I customize my Moodle page?

Change site name and course informationLog in with your administrator account.From the left panel (the Navigation drawer) click Site administration.Scroll down to the Front page section and click Front page settings.Change the long and short name of your site here.More items...•Nov 12, 2021

How do I change the layout of a Moodle course?

0:001:18How to Change Section Layout in Moodle - YouTubeYouTubeStart of suggested clipEnd of suggested clipSo you come over to edit settings on the administration panel. And when you go into the editMoreSo you come over to edit settings on the administration panel. And when you go into the edit settings you're gonna scroll down to course format. And in the course format you have area you have layout.

How do I add custom CSS theme to Moodle?

If you're not using SCSS, and prefer to use standard CSS for whatever reason, you can include the following in your theme's config. php file to load stylesheets within your theme's style directory: $THEME->sheets = array('stylesheetname');

How do you edit the front page in Moodle?

Editing Front page Settings in MoodleLog into the Moodle Dashboard.Navigate to Front page settings > Edit settings in the Settings section on the left. ... The Front page settings section will display with the options for editing the Front page.More items...•Aug 16, 2021

Can you customize Moodle?

For simpler customization, we've recently updated Edwiser RemUI with two new features: Live customizer – The live customizer lets you execute and preview changes in Moodle in real-time. There are 100+ customization options for you to personalize and change up how your Moodle looks.

How do you create a course layout?

Design Your CourseConsider timing and logistics.Recognize who your students are.Identify the situational constraints.Articulate your learning objectives.Identify potential assessments.Identify appropriate instructional strategies.Plan your course content and schedule.

What is a course layout?

Course maps organize the structure of a course around its learning modules. Each module is broken down into its components: module outcomes, assessments, activities, instruction, and then linked or mapped to the corresponding course learning outcome to show alignment.

What are the two most commonly used formats for a Moodle course site?

Format - refers to the layout of a course. Weekly and Topic are the two most commonly used. Hidden Sections - allows you to decide how the hidden sections in your course are displayed to students. Course Layout - Show one section per page is the only option at this time.May 21, 2021

How do you create a block in Moodle?

0:5616:37Moodle create a custom block - YouTubeYouTubeStart of suggested clipEnd of suggested clipBut block underscore is the main part of it. Then we've got a settings file and a version file DBMoreBut block underscore is the main part of it. Then we've got a settings file and a version file DB folder and inside the DB folder we've got some access.

How do I change my Moodle theme?

To change your theme:On your course page, from the Administration block, click Settings.From the Force theme drop-down menu, select the theme you want to try. Note: by default, the Moodle theme is Cornflower.At the bottom of the page, click Save changes.

How do you create a child theme in Moodle?

You need to start by logging onto your Moodle server, heading over to 'theme' folder and creating a folder for your theme name under it. The name of the folder should be the same as the name of the child theme. The minimum files/folders you require to create a child theme are: config.

Re: Custom CSS in courses

You can add CSS in Topic 0 of your course page. If you know how to write CSS, you should have no problem. Just make sure you click on the HTML tab before you begin to add your CSS mark-up. You need to astart and end it with the following tags...

Re: Custom CSS in courses

thanks for your answer! So in my outline I've edited the general topic ("edit summary") and inserted in the HTML source e.g.

Re: Custom CSS in courses

I believe the css in Topic0 works for that page (ie the course page itself) and you would have to add the required css code into the html of the additional page you have created - it is not inherited from the course page as the theme css is applied to the page.

Re: Custom CSS in courses

thank you for your answer. That's what I noticed. As far as I can see there's no possibility, to upload a separate css file and link all your pages to that single file. So to update the css on a larger range, one has to have admin privileges ... In other words, my teachers have no other option, than to write the css inline.

Re: Custom CSS in courses

Finally I've found a workaround solution for my problem and I want to share it here, just in case someone else wanna have custom css in his/her courses, too.

Re: Custom CSS in courses

I'd like to bump this issue up again as it is still a needed function for us.

Re: Custom CSS in courses

Create a child theme of your main one and apply that theme just to the course you need it for.

Why is consistent coding important?

A standard style helps to ensure that the code is easier to read and understand, which helps overall quality.

What is RTLCSS-PHP?

Using the tool RTLCSS- PHP, the styles are automatically flipped when the language is right-to-left. However, as there always are a few exceptions, special comments can be added to the CSS files to prevent rules from being flipped, etc...

Does camelcase follow Bootstrap 2?

They should use camelCase to follow Bootstrap 2 that is used in core. As for CSS selectors, use semantic names: names tell what this is instead of what should it look like. As Bootstrap 2 does, do not add the word "Color" to variables for _background_ or _border_ and their derivatives.

Does a clean theme have CSS?

Themes Clean and More. Clean theme should, where possible, not contain any CSS or LESS content. More theme, in comparison, inherits CSS styles for the logo from Clean theme, but also contains a small amount of LESS as an example for when customising a theme.

Does Moodle have Bootstrap 2?

As Moodle 2.7 has made Bootstrap 2 by default we can start using their classes, but we should make sure that there is a sensible fallback for themes not extending bootstrapbase, such as base .

Where should the class name be applied in HTML?

The class name should be applied to the root node for the element, it should never be applied any lower. By having one class for the element, and always and only applied to the root node it makes it very easy in HTML to see where one element belongs to another.

What is re-usable HTML?

Highly re-usable objects to produce HTML, these will be used consistently and relied upon by developers creating interfaces. By having these elements we create a consistent look, interface creation will be much quicker and theme designers through the re-use of a limited number of elements.

Can you add CSS to a plugin?

It is possible in Moodle to add CSS stylesheets to all plugins (including core plugins). Moodle always looks for a styles.css file within your plugins directory, and it also looks for a styles_themename.css where themename is the name of the currect theme being used.

image

Overview

File Naming

  • Within plugins, CSS files are normally named . In the theme, files can be named according to the theme designer's wishes but should: 1. use lowercase letters and '-' to separate words 2. be as succinct as possible 3. be descriptive 4. be placed in the folder style/ for CSS files, or in less/for LESS files.
See more on docs.moodle.org

Blocks

  1. Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.
  2. Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.
  3. The closing brace should use the same level of indentation as the opening selector.
  1. Each selector should be on its own line. If there is a comma in a selector list, follow it with a line break.
  2. Property-value pairs should be on their own line, with four spaces of indentation and an ending semicolon.
  3. The closing brace should use the same level of indentation as the opening selector.
  4. Leave one line between blocks.

Selectors

  1. Always use lower case and underscores or hyphens. Hyphens are preferred.
  2. Names should be made of simple English words.
  3. Verbosity is encouraged: names should be as illustrative as is practical to enhance understanding.
  4. Use semantic names: names tell what this is instead of what should it look like.
See more on docs.moodle.org

Properties and Values

  1. Should be separated by a colon and a single space, do not minify them.
  2. Should be lowercase, except for font names and vendor-specific properties.
  3. For color codes, lowercase is preferred and a shorthand whenever possible.
  4. For color codes, if you use HSLA or RGBA, always provide a hex fallback.
See more on docs.moodle.org

Units

  1. Allowed CSS units are px, rem, and em.
  2. Do not declare the unit when the value is 0.
See more on docs.moodle.org

Documentation and Comments

  • Following the general Coding style, comments should start with a capital letter and end with a period. A block-style comment at the top of the CSS file should explain the purpose of the rules in the file. Block-style comments can also be used to denote a section in a CSS file where all rules pertain to a specific component, view, or functionality: Use single-line comments to provide mor…
See more on docs.moodle.org

Progressive Enhancement

  1. Fallbacks should always be provided. For example, provide a background color fallback to background images and gradients.
  2. Use vendor prefixes only when the supported browser in question does not support the unprefixed property.
  3. The standard property should come after the vendor-prefixed property.
See more on docs.moodle.org

Browser Hacks

  • Do not use any browser-specific hacks. Moodle provides a more appropriate way to write browser-specific CSS using classes that are added to the body element. For example:
See more on docs.moodle.org

Plugins

  • In plugins, the file names can be: 1. styles.css (Recommended) 2. styles_<theme name>.css (Not recommended, reserved to 3rd party plugins)
See more on docs.moodle.org

Why Have A Strict Guide

  • At the time of writing this CSS within Moodle (2.7) themes is in a poor state and has been for a long time. Without previously having a guide we were finding that: 1. As there was no formal guide to creating id's or classes, each developer does their own thing. 2. As there was no formal guide on how to write CSS there were numerous techniques used when writing CSS and no consistenc…
See more on docs.moodle.org

Our Goals

  • Its very important to understand what we are trying to achieve with this style guide and output in general. Frontend framework agnostic 1. We want theme designers to be able to apply present and future frontend frameworks to Moodle with minimal effort. Consistent interfaces 1. We want Moodle to have consistency throughout its interfaces, minimising the amount of frontend desig…
See more on docs.moodle.org

Where to Put CSS in Moodle CORE

  • CSS can reside in a number of locations depending upon what you are styling. Remember it doesn't matter how many CSS files we end up with, on a production site with Theme designer mode switched off (default) all CSS files will be combined and minimised into a single file that is served to the client.Excepting the case of IE where we must split the CSS into several smaller fil…
See more on docs.moodle.org

Html

  • The following sections detail rules in place for writing HTML. Before we start a couple of general recommendations: Use hyphens rather than underscores when concatenating strings in attributes 1. for example .course-new-activity-chooser instead of .course_new_activity_chooser. By all doing this we will have a more consistent appearance and as We use underscores as part of frankenst…
See more on docs.moodle.org

CSS

  • Before we begin lets lay down some ground level goals, things that will help us achieve clear and understandable CSS in the future. 1. Formatting, ordering, alignment, and spacing are all important in having CSS that can be easily read by others. 2. Don't optimise your CSS, be verbose and stick to the styles in this guide. We have tools that will h...
See more on docs.moodle.org

See Also