CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

[How To] Create & Using the custom css classes

Here you can find some answers to your questions, and also some tutorials.

by Alexander Bulei » 17 Jun 2014 12:17

In this tutorial, we show you how to create and use custom css classes in your projects.

  1. You need create (or use existing) the custom css file (e.g: my-custom.css')
  2. Add your css classes.
  3. Save in wwwroot folder, e.g: 'customcss/my-custom.css'
  4. Load the saved css fle into project via ContentFiles.

    delphi code
    IWForm1.ContentFiles.Add('customcss/my-custom.css');

  5. Done, now you can use/add your custom css classes in components.

Another way, by using the ExtraHeader property of IWForm:

  • Just put your css classes inside <style></style> tag:
    delphi code
    with ExtraHeader do
    begin
    Add('<style type="text/css">');
    Add(' .my-css-class1 { color: #FFF; font-size: 12px; }');
    Add(' .my-css-class2 { background-color: red; }');
    Add(' .my-css-class3 { border: 1px solid #000; }');
    Add('</style>');
    end;

Useful links:

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

Return to Documentation / Tutorials

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.