The file location of the image is correct and it displays on localhost however doesn't online, how would i be able to get this to work?
I have tried changing the images from png to jpg and using different images and changing the file locations and then updating that on the code however it still does not display the image
<!DOCTYPE HTML>
<html>
<head>
<title>KMS</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta charset="UTF-8">
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script>
</head>
<body id="wrapper">
<div id="header">
<!--Logo-->
<div id="Logo">
</div>
<!--Logo-->
<!--Menu Buttons-->
<?php include 'menu.php';?>
<!--Menu Buttons-->
</div>
<div id="hContent">
<!--Frames--====================================================================-->
<div id="hFrames">
<!--Information go below-->
<div id="infoCon1">
<img id="kms_img" src="Images/Kmsproductsinformation.jpg" style="width:850px;"/>
<b />
<b />
</div>
<!--Information end-->
</div>
</div>
</div>
<!--
footer
-->
</body>
</html>
Try <img id="kms_img" src="images/kmsproductsinformation.jpg" style="width:850px;"/> and ensure that your images directory and kmsproductsinformation.jpg file are in lowercase.
You've got something funny going on with your DIVS. You have what looks like two additional close DIV tags () towards the end of your file - I'd start by fixing those up.
Having said that it also shouldn't really matter if it's localhost or not, or whether it's jpg or png but PNG would be better if you're setting it to a non-100% width.
Try something basic without all the DIVS or your menu.php file and see if that works.
<!DOCTYPE HTML>
<html>
<head>
<title>KMS</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta charset="UTF-8">
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script>
</head>
<body id="wrapper">
<img id="kms_img" src="Images/Kmsproductsinformation.jpg" />
</body>
</html>
Related
I have an HTML file with HTML code. How can I change from the HTML file to a PHP file?
The following is the HTML code:
<html>
<head>
<title>Instascan – Demo</title>
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/webrtc-adapter/3.3.3/adapter.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.10/vue.min.js"></script>
<script type="text/javascript" src="https://rawgit.com/schmich/instascan-builds/master/instascan.min.js"></script>
</head>
<body>
<div id="app">
<div class="sidebar">
<section class="scans">
<h2>Scans</h2>
<ul v-if="scans.length === 0">
<li class="empty">No scans yet</li>
</ul>
<transition-group name="scans" tag="ul">
<li v-for="scan in scans" :key="scan.date" :title="scan.content">{{ scan.content }}</li>
</transition-group>
</section>
</div>
<div class="preview-container">
<video id="preview"></video>
</div>
</div>
<script type="text/javascript" src="app.js"></script>
</body>
</html>
Change your HTML file extension. For example, index.html will be index.php.
Just change file extension .html to .php (index.html to index.php).
If you want to add any PHP code, you have to use the <?php and ?> tags.
In your case, just change the extension of your filename. Example: yourfilename.html to yourfilename.php.
I'm learning PHP / HTML / CSS. Today I want use Bootsrap.
I use a basic HTML5 template called index.php In this file I want include a footer like this:
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="ressources/bootstrap/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="ressources/css/style.css">
<script type='text/javascript' src="ressources/script/jquery.js"></script>
<script type='text/javascript' src="ressources/bootstrap/js/bootstrap.js"></script>
<title>Index</title>
</head>
<body>
<div id="wrap">
<p>test</p>
</div>
<?php include('includes/footer.php'); ?>
</body>
</html>
But I dont see my footer in my page. I just put an "Hello World" in my footer.php
I have a basic webpage made up of a few PHP pages and a few CSS stylesheets. One of these stylesheets is style_common.css which is used by all pages on the website to provide a constant theme. I am having a bit of trouble with this file. I currently have only 2 PHP pages which reference this common CSS file.
The home page (index.php) references the CSS file fine, and the stylesheet styles it as you would expect. I copied the entire contents of index.php and pasted it into a second PHP file, then changed a few minor details such as the heading caption. This new page however, doesn't link to the CSS stylesheet.
My code is below:
style_common.css:
body {
background-color: #32BEED;
}
.header {
text-align: center;
padding: 0px;
}
index.php:
<!DOCTYPE HTML>
<html>
<head>
<title>324 SQN Canteen Manager</title>
<link type="text/css" rel="stylesheet" href="style_index.css"/>
<link type="text/css" rel="stylesheet" href="style_common.css"/>
</head>
<body>
<div class="header">
<img src="images/logo.png" class="aafclogo">
<h3> Canteen Manager</h3>
<h6>Designed by Me</h6>
</div>
<div class="buttonContainer">
<a href="addstock.php"><div class="button">
<p>Add Stock</p>
</div></a>
<a href="sellitems.php"><div class="button">
<p>Sell Items</p>
</div></a>
<a href="recordstocktake.php"><div class="button">
<p>Record Stocktake</p>
</div></a>
</div>
The second page which I copied from index.php and changed a few minor fields:
<!DOCTYPE HTML>
<html>
<head>
<title>324 SQN Canteen Manager</title>
<link type="text/css" rel="stylesheet" href="style_index.css"/>
<link type="text/css" rel="stylesheet" href="style_addstock.css"/>
</head>
<body>
<div class="header">
<img src="images/aafclogo.png" class="aafclogo">
<h3>Add Stock</h3>
</div>
<div class="buttonContainer">
<a href="index.php"><div class="button">
<p>Home</p>
</div></a>
</div>
Just to give you an example, the background colour of the second page is white, not the colour specified in the CSS file.
Where am I going wrong? Thanks.
You are having the problem because you never linked
style_common.css
to the second page. Instead you have
<link type="text/css" rel="stylesheet" href="style_index.css"/>
<link type="text/css" rel="stylesheet" href="style_addstock.css"/>
FIX:
add
<link type="text/css" rel="stylesheet" href="style_common.css"/>
to the second page.
I want to merge two different html files into one,
html1.html
<html>
<head>
<link href="blah.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1 id="logo">
<span class="test1">Test text</span>
</h1>
</body>
</html>
html2.html
<html>
<head>
<script src="blah.js"></script>
</head>
<body>
<h1 id="logo">
<span>Test text</span>
<div class="test2">teststetset</div>
</h1>
</body>
</html>
I want to take these two files and make a master file that would look like this:
<html>
<head>
<link href="blah.css" rel="stylesheet" type="text/css" />
<script src="blah.js"></script>
</head>
<body>
<span class="test1">Test text</span>
<div class="test2">teststetset</div>
</body>
</html>
I want to know is this possible using php or any library or using Linux command?
This is my index.php file
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
</style>
</head>
<body>
<div id="container">
<?php
include('includes/header.php');
include('includes/sidebar.php');
include('includes/content.php');
include('includes/footer.php');
?>
</body>
</html>
This is code for my sidebar.php
<div id="sidebar">
<ul id="list">
<li>Home</li>
<li>flower</li>
<li>Study</li>
<li>Calendar</li>
<li>Diary</li>
</ul>
if I click flower, it will go to flower.php. I didn't include header, sidebar, and footer, and found that it shows only contents of flower.php, not showing header, sidebar, and footer. Is there any way to make it showing? Or should I just write down all the code below again?
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
</style>
</head>
<body>
<div id="container">
<?php
include('includes/header.php');
include('includes/sidebar.php');
include('includes/content.php');
include('includes/footer.php');
You should use your header, footer and sidebar on each of your page, because it won't create any problem because if you need to make change you would only change in required file and the change will occur in all other files as well. While content.php you should have your specific code for each page separately.
Hope this help