【问题标题】:style links in php tablephp表中的样式链接
【发布时间】:2009-10-22 20:35:40
【问题描述】:

我有一个 iframe,当从 html 页面提交表单时,它会在其中显示一个 php 页面。

是否可以使用一些 php 代码设置链接样式?如果有,怎么做?

谢谢

【问题讨论】:

    标签: php html


    【解决方案1】:

    只需使用 PHP 的 echo 添加一些 internalinline CSS 样式。

    一个例子(使用“heredoc”语法):

    echo <<<END
    <style type="text/css">
    a:link { color: blue; text-decoration: none; }
    a:visited { color: blue; text-decoration: none; }
    a:hover { color: red; text-decoration: underline; }
    a:active { color: red; text-decoration: underline; }
    </style>
    END;
    

    或者类似的东西。

    【讨论】:

      【解决方案2】:

      您可能希望使用 css,而不是 php,但是您可以将其解析到您的 php 文件中。

      <?php
      
      // code here....
      
      ?>
      <style type="text/css">
      iframe a {
        color:red;
      }
      </style>
      <?php
      
      // more code here....
      
      ?>
      

      【讨论】:

        猜你喜欢
        • 2011-02-14
        • 1970-01-01
        • 2020-01-13
        • 2013-04-08
        • 2012-09-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多