How to include a custom CSS file in TYPO3

10,731

You have to give each css file you want to include a unique key (e.g. myCssFile1). Also use a colon after the EXT:. So the correct way of including a CSS file with TypoScript would be

page.includeCSS.myCssFile1 = EXT:my_ext/Path/to/css_file.css
Share:
10,731
Aswathy S
Author by

Aswathy S

I am a PHP developer.I like Programming.I'm interested in API integration.

Updated on June 27, 2022

Comments

  • Aswathy S
    Aswathy S almost 2 years

    I need to build an Extension in typo3 7.6.I include a css file in setup.txt using

    page.IncludeCSS = Ext.Path_to_css_file.css
    

    But the styles in my css file is override by some other custom styles.How can I prevent this.Any Idea? I am new to typo3.Please help me.Thank you in advance.

    • Anu Bhuvanendran Nair
      Anu Bhuvanendran Nair almost 8 years
      Check your TS template include section.Please try to include your extension at the very last.
    • Aswathy S
      Aswathy S almost 8 years
      @AnuBhuvanendranNair my extension template is included very last.But it is not working
  • Daniel
    Daniel almost 8 years
    the includeCSS have to be with a lower case i. I updated the answer
  • Daniel
    Daniel almost 8 years
    Make sure your extension is installed, the path is correct and your identifier is unique. Then this works 100%.
  • sven
    sven almost 8 years
    Please give us the order of your static template includes and also the generated head html with the css includes. Third, tell us what css selector is overriding what other selector.
  • Welsh King
    Welsh King about 6 years
    which file in the extension do you add this ?