简体   繁体   English

无法在Drupal中编辑CSS文件

[英]CSS file in not being edit in drupal

I am trying to edit css "css_pF25-gpJPC5E_dzDNqsHs9AriR_AGzKkzgs-0VLNBgI.css" when me put any my css in above file like float:left no effect appear in front-end and , Why the css file name is too complicated in drupal , what should I do ? 当我将任何css放在float:left这样的文件中时,我正在尝试编辑css "css_pF25-gpJPC5E_dzDNqsHs9AriR_AGzKkzgs-0VLNBgI.css" float:left没有效果出现在前端,为什么在drupal中css文件名太复杂了,应该怎么做我做 ? it is in drupal it contain in "C:\\xampp\\htdocs\\drupal_1\\sites\\default\\files\\css" 它在drupal中,包含在“ C:\\ xampp \\ htdocs \\ drupal_1 \\ sites \\ default \\ files \\ css”中

You need to simply create css file at "projectname/sites/all/themes/theme_name/css/abc.css". 您只需在“项目名称/站点/所有/主题/主题名称/css/abc.css”中创建css文件。 Write css code. 编写CSS代码。

Clear cache from if using windows then 如果使用Windows,则清除缓存

"Home » Administration » Configuration » Development » Performance" this path and press clear all cache button. “主页»管理»配置»开发»性能”此路径,然后按清除所有缓存按钮。

if using linux go to the project path for example "/var/www/project_name/" and hit drush cc all it will clear all cache. 如果使用Linux,请转到项目路径,例如“ / var / www / project_name /”,然后按drush cc,将清除所有缓存。 and changes will be reflect. 变化将得到反映。

Note: You should installed drush module. 注意:您应该安装了drush模块。

Actually drupal merges all css and create a css file with dynamic name. 实际上,drupal合并所有css并创建具有动态名称的css文件。

Hpe it will help you. 希望对您有帮助。 Happy coding. 快乐的编码。

Stop, why you CSS file named "css_pF25-gpJPC5E_dzDNqsHs9AriR_AGzKkzgs-0VLNBgI.css"? 停止,为什么您的CSS文件名为“ css_pF25-gpJPC5E_dzDNqsHs9AriR_AGzKkzgs-0VLNBgI.css”? Create normal style.css file, put on theme_floder/css/ and include style in theme.info file. 创建普通的style.css文件,放在theme_floder / css /上,然后将样式包含在theme.info文件中。 But i don't understend you question? 但是我不明白你的问题吗?

You are trying to edit a temporary file generated by Drupal's cache. 您正在尝试编辑由Drupal的缓存生成的临时文件。 Edit your actual CSS file (you can find this in the .info file of your theme) and then clear the cache: /admin/config/development/performance 编辑您的实际CSS文件(您可以在主题的.info文件中找到此文件),然后清除缓存:/ admin / config / development / performance

I am quite confused how you got "css_pF25-gpJPC5E_dzDNqsHs9AriR_AGzKkzgs-0VLNBgI.css" in your DRUPAL file system. 我很困惑您如何在DRUPAL文件系统中获得“ css_pF25-gpJPC5E_dzDNqsHs9AriR_AGzKkzgs-0VLNBgI.css”。

Since its aggregated CSS file, you wont find any CSS file which has named like that. 由于该文件是聚合的CSS文件,因此找不到像这样命名的CSS文件。 CSS aggregation is being done by DRUPAL end. CSS聚合由DRUPAL端完成。

So best way of doing this is, got to following path: In admin menu, 因此,执行此操作的最佳方法是转到以下路径:在管理菜单中,

Configuration >> Development >> Performance. 配置>>开发>>性能。 In this page under "BANDWIDTH OPTIMIZATION" section, you see "Aggregate and compress CSS files" check box. 在此页面的“带宽优化”部分下,您将看到“聚合和压缩CSS文件”复选框。

DE-select that check box and clear DRUPAL cache. 取消选中该复选框,然后清除DRUPAL缓存。 And then inspect element which CSS your are going to change, there you see exact CSS file name which not is aggregated one.Go to that CSS file and make CSSchanges and save. 然后检查要更改的CSS元素,您会看到确切的CSS文件名,该文件未汇总在一起。转到该CSS文件并进行CSS更改并保存。

Then clear Drupal cache and you need to clear browser history also some times. 然后清除Drupal缓存,您还需要清除浏览器历史记录。

Then see changes on front end. 然后查看前端的更改。 If changes effected , go to Configuration >> Development >> Performanace ,check "Aggregate and compress CSS files" check box. 如果更改生效,请转到“配置” >>“开发” >>“性能”,选中“聚合和压缩CSS文件”复选框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM