我已经直接在index.php文件中更改了Joomla模板中的背景图像以及头图像。我更改了镜像src。我的问题是,当我在平板电脑或移动设备上打开网站时,这两张图片会丢失,但在台式机上没有问题。我已经检查了@media查询的所有内容,但找不到这个问题。求求你我需要帮助!她带着index.php代码
<?php
/**
* Date July 31, 2014
* Copyright Copyright (C) 2014 10templates.com
* License GPL
*/
defined( '_JEXEC' ) or die;
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$this->language = $doc->language;
$this->direction = $doc->direction;
JHtml::_('bootstrap.framework');
?>
<?php include_once("analyticstracking.php") ?>
<!DOCTYPE html>
html xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this- >language; ?>" >
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=yes"/>
<meta name="HandheldFriendly" content="true"/>
<meta name="apple-mobile-web-apple-capable" content="true"/>
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/menu.js"></script>
<!--script src="/media/jui/js/bootstrap.min.js" type="text/javascript"> </script>
<script src="/media/jui/css/bootstrap.min.css" type="text/css"></script-->
</head>
<body>
<!--main container -->
<div class="container-fluid">
<!--Begin header-->
<div class="header">
<div class="header-inner">
<jdoc:include type="modules" name="position-2" style="none" />
<header class="jumbotron">
<img src="http://localhost/joomla/images/utv_pics/utv_transparent.gif" style="max-width:90%">
<!--Begin Navbar-->
<?php if ($this->countModules('position-1')) : ?>
<div class="nav2">
<!--button type="button" class="navbar-toggle" data-toggle="collapse" data-target="nav2">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="index.php"><?php echo $sitename ?></a>
<div class="collapse nav-collapse" id="nav2"-->
<jdoc:include type="modules" name="position-1" style="none" />
<!--End navbar-->
<?php endif; ?>
</header></div></div></div>
<div class="container-fluid">
<div class="clearfix">
<div class="leftCont">
</div>
<div id="content" role="main">
<?php if ($this->countModules('position-9')) : ?>
<div class="banners">
<jdoc:include type="modules" name="position-9" style="none" />
</div>
<?php endif; ?>
<!-- Begin Content -->
<div class="insider">
<jdoc:include type="component" />
<jdoc:include type="modules" name="position-3" style="none" />
</div>
<!-- End Content -->
</div>
<div class="rightCont">
<div class="clearfix">
</div></div></div></div>
<div class="container-fluid">
<footer class="clearfix">
<section>
<?php if ($this->countModules('position-4')) : ?>
<jdoc:include type="modules" name="position-4" style="xhtml" />
<?php endif; ?>
</section>
<section>
<?php if ($this->countModules('position-5')) : ?>
<jdoc:include type="modules" name="position-5" style="xhtml" />
<?php endif; ?>
</section>
<section>
<?php if ($this->countModules('position-6')) : ?>
<jdoc:include type="modules" name="position-6" style="xhtml" />
<?php endif; ?>
</section>
</footer>
</div></div>
</body>
</html>发布于 2016-06-06 22:41:31
您已经添加了本地镜像URL:
<img src="http://localhost/joomla/images/utv_pics/utv_transparent.gif" style="max-width:90%">如您所见,URL指向本地开发工作站localhost。该地址在其他设备上不起作用。
您应该改用baseurl属性:
<img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/utv_pics/utv_transparent.gif" style="max-width:90%">并确保您的图像图片位于当前模板文件夹内的utv_transparent.gif /utv_文件夹中。
发布于 2016-06-07 11:07:38
你有一个错误的镜像位置,只能在你的电脑上运行。
而不是
<img src="http://localhost/joomla/images/utv_pics/utv_transparent.gif" style="max-width:90%">
只需使用以下代码
<img src="/images/utv_pics/utv_transparent.gif" style="max-width:90%">
https://stackoverflow.com/questions/37660141
复制相似问题