Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将CSS应用于PHP加载的HTML_Php_Html_Css - Fatal编程技术网

将CSS应用于PHP加载的HTML

将CSS应用于PHP加载的HTML,php,html,css,Php,Html,Css,我为一个div类设置了一个样式,用于从这个文本文件加载的一些html content.txt <div class="container"> <main class="content"> <strong>Paragraph Title</strong> <br> Lots of text that actually goes here. &l

我为一个div类设置了一个样式,用于从这个文本文件加载的一些html

content.txt

<div class="container">
    <main class="content">
        <strong>Paragraph Title</strong> <br>                                
Lots of text that actually goes here.
    </main><!-- .content -->
</div><!-- .container-->

段落标题
这里有很多文字。
事实上,
标记之间的文本看起来与该文本的其余部分没有任何不同

CSS


#自动幻灯片放映{
位置:相对位置;
z指数:1;
溢出:隐藏;
保证金:0自动;
高度:300px;
边框:2px实心#333333;
盒影:0 5px 0#000;
-网络工具包盒阴影:0 5px 0#666;
}
#自动幻灯片放映{
身高:100%;
宽度:25%;
位置:绝对位置;
左缘:32.5%;
z指数:1;
不透明度:0;
-webkit过渡:不透明度。8s线性;
}
#自动幻灯片放映img.show{
不透明度:1;
}
.内容{
右边框:实心1px#999999;
}
HTML


下面是我检查元素时显示的内容

更新


我将边框的大小增加到了疯狂的大小(100px),发现文本环绕着应该是边框的部分,但仍然没有显示边框。

检查样式表。在inspect element面板中,它显示padding属性定义了两个不同的时间,一个在
113
行,另一个在
162
行。请记住,css使用最后一个定义,因此您应该:

  • 在第162行之后指定规则
  • 删除第162行中的规则
  • 使用
    !重要信息
    在第一个定义中添加标记,以便使用该定义

  • 其中任何一个都应该起作用

    这可能与字体、字重、字号有关。。。尝试使用
    strong{color:red}
    设置不同的颜色,如果您不满意,您还可以检查元素(在大多数现代浏览器中)以检查它是否从CSS中获得任何样式。@Calimero我也尝试过,只是没有在这里发布该代码。我还将边框的大小设置为100像素,但仍然没有。如何集成CSS代码?链接元素,样式元素?请粘贴该标记代码。@CodyHarness所以下一步:打开包含该项的代码文件。使用SVN查找是谁添加了该规则。走到他们的办公桌前,把一大块奶油派砸在他们的脸上。(但是是的:这条规则是你的问题。
    font:inherit
    的意思是“在所有方面完全模仿包含这条规则的元素的字体”)我更希望人们清理不必要的/过度的规则,而不是简单地玩一场无法获胜的优先级军备竞赛。关于军备竞赛的比喻,
    !重要信息
    是核武器。唯一的赢家是不要玩。
    <style type="text/css">
    #auto-slideshow {
      position:relative;
      z-index:1;
      overflow:hidden;
      margin:0 auto;
      height:300px;
      border:2px solid #333333;
      box-shadow:0 0 5px 0 #000;
      -webkit-box-shadow:0 0 5px 0 #666;
    }
    
    #auto-slideshow img {
      height: 100%;
      width: 25%;
      position:absolute;
      margin-left: 32.5%;
      z-index:1;
      opacity:0;
      -webkit-transition:opacity .8s linear;
    }
    
    #auto-slideshow img.show {
      opacity:1;
    }
    
    .content {
      border-right: solid 1px #999999;
    }
    </style>
    
    <div class="middle">
    
        <?php 
          echo file_get_contents( "modules/content.txt" ); // get the contents, and echo it out.
        ?>                               
    
        <?php 
          echo file_get_contents( "modules/leftSidebar.txt" ); // get the contents, and echo it out.
        ?> 
    
        <?php 
          echo file_get_contents( "modules/rightSidebar.txt" ); // get the contents, and echo it out.
        ?>
    
      </div><!-- .middle-->