html - Problems with CSS and include function in PHP -


i trying develop website in php. on main page use include function (in php) include other files in it. when load main page css in other files screwed up. showing if there no css @ on top of each other. when load files separately works fine.

so in index.php file have

//code  include 'toolbar.php'; 

then in toolbar.php have

div.fileinputs  {     position: relative; }  div.fakefile  {     position: absolute;     top:0px;     left:0px;     z-index: 10; } .text_computer {     position: absolute;     top:80px;     left:20px;     z-index: 20;     text-align:center } input.file  {     cursor: pointer;     position: relative;     text-align: right;     -moz-opacity:0 ;     filter:alpha(opacity: 0);     opacity: 0;     z-index: 30;     width:317;     height:202; } .text_upload {     position: absolute;     top:6px;     left:80px;     z-index: 20;     text-align:center } input.submit {     cursor: pointer;     position: relative;     text-align: right;     -moz-opacity:0 ;     filter:alpha(opacity: 0);     opacity: 0;     z-index: 30;     width:330;     height:50; } //code <div class="fileinputs">             <input type="file" class="file" name='image'/>             <div class="fakefile">                 <img src='red_frame.png' width='330'>             </div>             <div class="text_computer">                 <a style='font-family:arial;color:white;'><font size='6'>choose photo from<br> computer</font></a>             </div>         </div>         <div class="des_box">             <textarea name='description' cols='38' rows='4' placeholder='enter description here...' maxlength='500'></textarea><br>         </div>         <br>         <div class="fileinputs">             <input type="submit" class="submit" value='upload'>             <div class="fakefile">                 <img src='red_frame.png' width='330' height='50'>             </div>             <div class="text_upload">                 <a style='font-family:arial;color:white;'><font size='6'>upload!!!!</font></a>             </div>         </div> 

this isn't of code part piling on top of each other when include in index.php

when run toolbar.php spaced out fine.

is there way fix this?

could there other sort of problem causing this?

wait never mind found <!doctype html> @ top of index.php , removed see if fix problem , reason did. have no idea why fixed it, works.

i suggest not use 'include', please try in following way-

<?php  . . . ?> <link href="../bootstrap/css/bootstrap-timepicker.min.css" rel="stylesheet"  type="text/css"/> <?php  . . . ?> 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -