需要帮助将代码点火器中的HTML / CSS文件转换为模板

时间:2011-03-27 01:09:55

标签: php codeigniter

我无法将代码点火器中的HTML / CSS / javascript和jquery移动到模板中。 这是我的HTML代码

    <div id="container" >
    <div id = "header">    
        <div>
            <a id = "logo" href="index.php"> </a>       
        </div>    
        <div id="topnav" class="topnav"> <a href="registration.php" class="register"> <span> Register </span></a>
          <a href="" class="signin"><span> Login</span></a> 
        </div>         
    </div>
    <fieldset id="signin_menu" style="right:auto;z-index:2001;left:70%;">
        <form method="POST" id="signin" action="login.php" >
            <label for="username">Username or email</label>
              <input id="username" name="username" value="" title="username" tabindex="4" type="text"/>
               <p>
                <label for="password">Password</label>
                <input id="password" name="password" value="" title="password" tabindex="5" type="password"/>
              </p>
              <p class="remember">
                <input type="hidden" name="originating_uri" value="<?php $_REQUEST['originating_uri'] ?>" />
                <input id="signin_submit" value="Login" tabindex="6" type="submit" name="submit"/>
                <input id="remember" name="remember_me" value="1" tabindex="7" type="checkbox"/>
                <label for="remember">Remember me</label>
              </p>
              <p class="forgot"> <a href="#" id="resend_password_link">Forgot your password?</a> </p>
              <p class="forgot-username"> <a id=forgot_username_link
                title="If you remember your password, try logging in with your email" 
                href="#">Forgot your username?</a>
              </p>
        </form>
    </fieldset>

    <div id="menubar">
        <ul class="menulist">
            <li>
                <a href="index.php">Home </a>
                <a href="#">Generator </a>
                <a href="#">News </a>
                <a href="#">Forum </a>
                <a href="#">About </a>
                <a href="feedback.php"> Feedback </a>
            </li>
        </ul>
        <ul id="search">
            <li>
                <form id="searchform" action="" method="POST" name="searchform"> 
                    <input type="text" maxlength="10" value="Search" name="search" style="color: rgb(#999);" 
                        onclick="document.searchform.search.value='';"/>
                    <input type="submit" name="submit_search" value="Search" />
                </form>
            </li>
        </ul>
    </div>
</div>

    <div id="maincontent">
        <div id="flashcontent">
            Flash content goes here !!
        </div>

        <div id="resources">
            Resources/ News goes here !!
        </div>
    </div>

我在template.php中有以下代码

$template['default']['regions'] = array(
   'logo' => array(
        'content' => array(''),
        'name' => 'Logo',
        'wrapper' => '<a>',
        'attributes' => array('id' => 'logo', 'href' => 'index.php')
    ),
    'menulist' => array(
        'content' => array(''),
        'name' => 'Menulist',
        'wrapper' => '<ul>',
        'attributes' => array('class' => 'menulist', 'id' => 'search')
    ),
   'flashcontent' => array(
       'content' => array('Flash content goes here !!'),
       'name' => 'Flashcontent',
       'wrapper' => '<div>',
       'attributes' => array('id' => 'flashcontent')
   ),
    'resources' => array(
       'content' => array('Resources content goes here !!'),
       'name' => 'Resources',
       'wrapper' => '<div>',
       'attributes' => array('id' => 'resources')
   ),
   'footer' => array(
       'content' => array('<ul> 
                            <li> <a href="#">Home</a>
                            <a href="#">News & Events</a>
                            <a href="#">Forum</a>
                            <a href="#">About us</a>
                            <a href="#">Contact us</a>
                            <a href="#">Terms of use</a>
                            <a href="#">Privacy policy</a>
                            <a href="#">Site map</a>
                            </li>
                           </ul>'),
       'name' => '',
       'wrapper' => '<div>',
       'attributes' => array('id' => 'footertable1')
   )
);

我的问题:

  1. 带有徽标的div标签必须是图像。不知何故,我无法从文件夹中检索图像。

  2. 我有一个基于jquery的登录字段集。我不确定如何添加template.php

  3. 带有菜单栏的div标签包含带menulist的类和带搜索的id以及其中的表单。我对如何将其添加到我的模板感到困惑。

  4. 如果有人能帮助我,我将不胜感激

2 个答案:

答案 0 :(得分:0)

1)为什么div标签必须是图像?这没有多大意义。你是说它应该使用img标签?你为什么不用css将背景图片添加到你的标签?

我担心我不明白你在问题2和3中提出的问题。

答案 1 :(得分:0)

您可以制作徽标类并将其添加到特定的div中,如下所示:

<div class="logo">
    <a id = "logo" href="index.php"> </a>       
</div>  

并且在CSS中你可以这样做以在div中放置一个图像(Logo):

.logo{
    background-image:url(/* path to the image from your CSS file directory */);
}