PHP if / else条件以某种方式覆盖CSS

时间:2016-10-06 10:04:18

标签: php css twitter-bootstrap

存在按会话识别用户的登录页面,如果会话存在则会输入他们的姓名,否则会生成“你好”的用户,请注册'。

if条件工作正常,但不存在的会话的else条件不是应用我的main.css规则,但它确实应用了bootstrap.css。 我的头首先加载Jquery,然后加载bootstrap然后加载我的main.css。

<div id="full-background">
    <div class="text-box">
        <h1>Hello <?php
            if(isset($_SESSION['usr_id'])) {
                echo $_SESSION['usr_name'].'</h1><script>$(\'#full-background\').delay(1200).animate({
            \'opacity\': 0
        }, 1900, function () {
            $(this).animate({
                zIndex: -1
            }, 10, function () {
                console.log(\'finished zIndex\');
            });
            }
        );</script>';
            }else{
                echo 'User</h1><button>Click Here to Register</button>';} ?>
    </div>
</div>

我该如何解决这个问题? 感谢。

0 个答案:

没有答案