Heim  >  Artikel  >  Backend-Entwicklung  >  这种情况能使用外部样式表或者内部样式表吗?该怎么处理

这种情况能使用外部样式表或者内部样式表吗?该怎么处理

WBOY
WBOYOriginal
2016-06-13 13:40:361063Durchsuche

这种情况能使用外部样式表或者内部样式表吗?
我有一个menu.php,menu.php中定义了左右页面都有的导航菜单部分,即head标签对和body标签都在menu.php中,head标签对之间使用了一个外部样式表style1.css,其他php都require了menu.php。
例如customer.php中require了menu.php,custom.php中不属性menu.php中的那些元素的stype只能使用内联样式表吗?还是可以定义style1.css中?
我在customer.php为html标签定义了class属性,在style1.css中对这个class设置了css属性,结果不起作用。应该起作用吗?


------解决方案--------------------
应该有其他的原因吧!
------解决方案--------------------
至少你没有说清楚你遇到的问题,style有继承关系,这是大家都知道的
------解决方案--------------------
按理应该起作用。
我想你应该检查样式表是否被加载,href是否正确。如果你用chrome浏览器的话,审查元素功能可以帮你看到

的所有style属性
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn