Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  | Правила  

Компьютерный форум OSzone.net » Компьютеры + Интернет » Вебмастеру » Как выставить фотографии по центру

Ответить
Настройки темы
Как выставить фотографии по центру

Старожил


Сообщения: 300
Благодарности: 16


Конфигурация

Профиль | Отправить PM | Цитировать


Изменения
Автор: VINDIGO1
Дата: 09-02-2013
Изображения
Тип файла: jpg Снимок.jpg
(55.7 Kb, 3 просмотров)
Здравствуйте, есть сайт http://mzoloto37.ru, подскажите как мне выставить фотографии по центру, но только как для чайника? )) Ещё когда размер картинки уменьшаешь и выставить в зону шаблона "advert2", в "предварительном просмотре" всё встаёт по центру, а на самом сайте всё равно находится слева, если бы поиграть с размером и с зонами то я бы подогнал на центр, но на самом сайте оно не перемещается, вот в чём проблема . Сайт на joomla 2.5.9.

Вот код шаблона главной страници
Код: Выделить весь код
<?php
/*------------------------------------------------------------------------
# "Hot Photo Portfolio" Joomla template - April, 2010
# Copyright (C) 2010 ArhiNet d.o.o. All Rights Reserved.
# License: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
# Author: HotJoomlaTemplates.com
# Website: http://www.hotjoomlatemplates.com
-------------------------------------------------------------------------*/
defined( '_JEXEC' ) or die( 'Restricted access' );
define( 'YOURBASEPATH', dirname(__FILE__) );
$template_path = $this->baseurl.'/templates/'.$this->template;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />

<?php  // module states
    
    $showadvert[1] = $this->countModules('advert1');
    $showadvert[2] = $this->countModules('advert2');
    $showadvert[3] = $this->countModules('advert3');
    $showadvert[4] = $this->countModules('advert4');
    $showuser1 = $this->countModules('user1');
    $showuser2 = $this->countModules('user2');
    $showuser3 = $this->countModules('user3');
    $showuser[5] = $this->countModules('user5');
    $showuser[6] = $this->countModules('user6');
    $showuser[7] = $this->countModules('user7');
    $showuser[8] = $this->countModules('user8');
    $showfooter[1] = $this->countModules('footer1');
    $showfooter[2] = $this->countModules('footer2');
    $showfooter[3] = $this->countModules('footer3');
    $showfooter[4] = $this->countModules('footer4');    
    $showleft = $this->countModules('left');
    $showright = $this->countModules('right');
    $showbreadcrumbs = $this->countModules('breadcrumbs');
    
    $uppermodules = 0;
    for ($loop = 1; $loop <= 4; $loop += 1) {
      if($showadvert[$loop]) { $uppermodules++; }
    }
    
    $bottommodules = 0;
    for ($loop = 5; $loop <= 8; $loop += 1) {
      if($showuser[$loop]) { $bottommodules++; }
    }
    
    $footermodules = 0;
    for ($loop = 1; $loop <= 4; $loop += 1) {
      if($showfooter[$loop]) { $footermodules++; }
    }
?>

<?php  // template parameters
    
    // template layout
    $templateWidth = $this->params->get("templateWidth", "980");
    $textDirection = $this->params->get("textDirection", "ltr");
    $columnLeftWidth = 0; $columnRightWidth = 0; $columnLeftPad = 0; $columnRightPad = 0;
    if ($showleft) {
      $columnLeftWidth = $this->params->get("columnLeftWidth", "285"); 
      $columnLeftPad = 15;
    }else{
      $columnLeftWidth = 0;
      $columnLeftPad = 0;
    }
    if ($showright) {
      $columnRightWidth = $this->params->get("columnRightWidth", "285");
      $columnRightPad = 15;
    }else{
      $columnRightWidth = 0;
      $columnRightPad = 0;
    }
    $contentWidth = $templateWidth - $columnLeftWidth - $columnLeftPad - $columnRightWidth - $columnRightPad;
    $overallWidth = $templateWidth;
    
    // add-ons
    $imageReflectionLoad = $this->params->get("imageReflectionLoad", "1");
    $fontResizeLoad = $this->params->get("fontResizeLoad", "1");
    
    // template style
    
      // check if in parameters
      $templateStyle = $this->params->get("templateStyle", "1");
      
      // check if it cookie
      if(isset($_COOKIE['Style']))
      {
      $templateStyle = $_COOKIE['Style'];
      }
      
      $templateStyleTest = "";
      
      // check if in link
      if (isset($_GET['style'])) {
        $templateStyleTest = $_GET['style'];
      }
      
      if ($templateStyleTest) { 
        $templateStyle = $templateStyleTest;
        $Month = 2592000 + time(); 
        setcookie("Style", $templateStyle, $Month);
      }
    
    if($templateStyle) {
      
    require(YOURBASEPATH."/styles/style".$templateStyle.".php");
      
    }else{

    $bodyText = $this->params->get("bodyText", "#7B7F80");
    $linksColor = $this->params->get("linksColor", "#ADA9AA");  
    $bgStyle = $this->params->get("bgStyle", "5");
    $solidBg = $this->params->get("solidBg", "#000000");  
    $menuAnimationEffect = $this->params->get("menuEffect", "fadeIn(700)");  
    $topMenuButton = $this->params->get("topMenuButton", "#000000");
    $topMenuHoverButton = $this->params->get("topMenuHoverButton", "#FFFFFF");
    $topMenuText = $this->params->get("topMenuText", "#9A5A1C");
    $topMenuHoverText = $this->params->get("topMenuHoverText", "#FFFFFF");
    $topMenuSubBg = $this->params->get("topMenuSubBg", "#000000");
    $topMenuSubBgHover = $this->params->get("topMenuSubBgHover", "#FFD441");
    $topMenuSubText = $this->params->get("topMenuSubText", "#FFFFFF");
    $topMenuSubTextHover = $this->params->get("topMenuSubTextHover", "#000000");
    $breadcrumbsText = $this->params->get("breadcrumbsText", "#ffffff");
    $bottomHeading = $this->params->get("bottomHeading", "#ADA9AA");
    $bottomText = $this->params->get("bottomText", "#7B7F80");
    $componentHeadingText = $this->params->get("componentHeadingText", "#ADA9AA");
    $headingText = $this->params->get("headingText", "#ADC205");
    $headingHoverText = $this->params->get("headingHoverText", "#ADC205");
    $columnHeading = $this->params->get("columnHeading", "#ADA9AA");
    $columnText = $this->params->get("columnText", "#7B7F80");
    $moduleFirstWord = $this->params->get("moduleFirstWord", "#ADC205");
    $color1 = $this->params->get("color1", "yellow");
    $color2 = $this->params->get("color2", "green");
    
    }
?>

<link rel="stylesheet" href="<?php echo $template_path ?>/css/template_css.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $template_path ?>/css/layout.css" type="text/css" />
<?php if ($textDirection=="rtl") { ?>
<link rel="stylesheet" href="<?php echo $template_path ?>/css/rtl.css" type="text/css" />  
<?php } ?>
<style type="text/css">
<!--
<?php require(dirname(__FILE__).DS.'/css/template_css.php'); ?>
-->
</style>
<!--[if lt IE 9]>
<style type="text/css">
#nav li.active {
  behavior: url(<?php echo $template_path ?>/css/PIE.php);
}
</style>
<![endif]-->

<script type="text/javascript" src="<?php echo $template_path ?>/js/jquery.min.js"></script>
<script type="text/javascript">
     jQuery.noConflict();
</script>

<!-- top menu -->
<script type="text/javascript">
function mainmenu(){
jQuery(" #nav ul ").css({display: "none"}); // Opera Fix
jQuery(" #nav li ").hover(function(){
    jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).<?php echo $menuAnimationEffect; ?>;
    },function(){jQuery(this).find('ul:first').css({visibility: "hidden"});  });}
jQuery(document).ready(function(){ mainmenu();});
</script>

<?php if($imageReflectionLoad) { ?>
<!-- reflection -->
<script type="text/javascript" src="<?php echo $template_path ?>/js/reflection.js"></script>
<?php } ?>

<?php if($fontResizeLoad) { ?>
<!-- font resizer -->
<script type="text/javascript" src="<?php echo $template_path ?>/js/fontResize.js"></script>
<?php } ?>

<!--[if IE 6]>
<script type="text/javascript" src="<?php echo $template_path ?>/js/pngfix.js"></script>
<script>
  POS_BrowserPNG.fix('img,.content_wrap,ul.checklist li,ul.arrow li,ul.star li,.header_module,.footer_content');
</script>
<link rel="stylesheet" href="<?php echo $template_path ?>/css/ie6only.css" type="text/css" />
<![endif]-->


</head>
<body>
<div id="header_wrap">
  <div class="header_module">
      <div class="logo">
          <div class="logo_pad">
            <a href="index.php"><img src="<?php echo $template_path ?>/images/logo.png" width="255" height="25" alt="joomla photo portfolio" /></a>
            </div>
        </div>
        <div id="header_search">
          <div class="header_search_pad">
            <jdoc:include type="modules" name="user4" style="none" />
            </div>
        </div>
        <div class="clr"></div>
    </div>
</div>
<div class="topmenu_wrap">
    <div class="topmenu">
        <jdoc:include type="modules" name="user3" style="none" />
    </div>
</div>
<div id="content_gradient">
    <div class="hotwrapper">
        <?php if ($uppermodules) { ?>
        <div class="upper">
            <?php if($showadvert[1]) { ?>
            <div class="modulerow<?php echo $uppermodules; ?>"><jdoc:include type="modules" name="advert1" style="none" /></div>
            <?php } if($showadvert[2]) { ?>
            <div class="modulerow<?php echo $uppermodules; ?>"><jdoc:include type="modules" name="advert2" style="hot" /></div>
            <?php } if($showadvert[3]) { ?>
            <div class="modulerow<?php echo $uppermodules; ?>"><jdoc:include type="modules" name="advert3" style="hot" /></div>
            <?php } if($showadvert[4]) { ?>
            <div class="modulerow<?php echo $uppermodules; ?>"><jdoc:include type="modules" name="advert4" style="hot" /></div>
            <?php } ?>
            <div class="clr"></div>
        </div>
        <?php }else{ ?>
        <div class="upper"></div>
        <?php } ?>
        <div class="main_area">
            <?php if ($showleft) { ?>
            <div class="column_left">
              <div class="column_left_pad">
                  <jdoc:include type="modules" name="left" style="hot" />
                </div>
            </div>
            <?php } ?>
                <div class="content_wrap">
                        <div class="content_pad">
                            <?php if ($showuser1) { ?>
                            <div class="module_inset">
                                <jdoc:include type="modules" name="user1" style="hot" />
                            </div>
                            <?php } ?>
                            
                                <jdoc:include type="message" />
                                <jdoc:include type="component" />
                            
                            <?php if ($showuser2) { ?>
                            <div class="module_toolbar">
                                <jdoc:include type="modules" name="user2" style="hot" />
                            </div>
                            <?php } ?>
                        </div>
                <div class="clr"></div>
            </div> 
            <?php if ($showright) { ?>
            <div class="column_right">
              <div class="column_right_pad">
                  <jdoc:include type="modules" name="right" style="hot" />
                </div>
            </div>
            <?php } ?>
            <div class="clr"></div>
        </div>
        <?php if ($showbreadcrumbs) { ?>
        <div class="path">
            <div class="path_pad">
                <jdoc:include type="modules" name="breadcrumbs" style="none" />
                <jdoc:include type="modules" name="carousel" style="none" />
            </div>
        </div>
        <?php } ?>
        <?php if ($bottommodules) { ?>
        <div class="bottom">
            <?php if($showuser[5]) { ?>
            <div class="modulerow<?php echo $bottommodules; ?>"><jdoc:include type="modules" name="user5" style="hot" /></div>
            <?php } if($showuser[6]) { ?>
            <div class="modulerow<?php echo $bottommodules; ?>"><jdoc:include type="modules" name="user6" style="hot" /></div>
            <?php } if($showuser[7]) { ?>
            <div class="modulerow<?php echo $bottommodules; ?>"><jdoc:include type="modules" name="user7" style="hot" /></div>
            <?php } if($showuser[8]) { ?>
            <div class="modulerow<?php echo $bottommodules; ?>"><jdoc:include type="modules" name="user8" style="hot" /></div>
            <?php } ?>
            <div class="clr"></div>
        </div>
        <?php } ?>
    </div>
</div>
<div class="footer_wrap">
  <div class="footer_content">
      <?php if ($footermodules) { ?>
        <div class="footer_modules">
            <?php if($showfooter[1]) { ?>
            <div class="modulerow<?php echo $footermodules; ?>"><jdoc:include type="modules" name="footer1" style="hot" /></div>
            <?php } if($showfooter[2]) { ?>
            <div class="modulerow<?php echo $footermodules; ?>"><jdoc:include type="modules" name="footer2" style="hot" /></div>
            <?php } if($showfooter[3]) { ?>
            <div class="modulerow<?php echo $footermodules; ?>"><jdoc:include type="modules" name="footer3" style="hot" /></div>
            <?php } if($showfooter[4]) { ?>
            <div class="modulerow<?php echo $footermodules; ?>"><jdoc:include type="modules" name="footer4" style="hot" /></div>
            <?php } ?>
            <div class="clr"></div>
        </div>
        <?php } ?>
    </div>
</div>
<div class="footer_wrap_copyright">
    <div class="footer_wrap_copyright_content">
        <div class="footer">
            <div class="footer_pad">
                <jdoc:include type="modules" name="footer" />
            </div>
        </div>
        <div class="footer2">
            <div class="footer_pad">
                <jdoc:include type="modules" name="bottom" style="none" />
            </div>
        </div><div class="clr"></div>
    </div>
</div>
<div style="clear:both"></div>
<jdoc:include type="modules" name="debug" style="none" />    
</body>
</html>
Вот что ещё нарыл, в настройках шаблона есть такой пункт "Text Direction" с двумя параметрами "Left to Right" и "Right to Left ", при смене этих параметров меняется расположение всех элементов, вот если бы там был доп. параметр "ЦЕНТР" то все бы выровнялось по центру и было бы идеально, вот как в тему добавить этот пункт?
Вот ещё код и файла "css/layout.css"

читать дальше »
/*------------------------------------------------------------------------
# "Hot Photo Portfolio" Joomla template - April, 2010
# Copyright (C) 2010 ArhiNet d.o.o. All Rights Reserved.
# License: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
# Author: HotJoomlaTemplates.com
# Website: http://www.hotjoomlatemplates.com
-------------------------------------------------------------------------*/

html {
font-size:11px;
}

body {
margin:0;
padding:0;
font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
line-height:18px;
}

.hotwrapper {
margin:0 auto;
position:relative;
height:auto;
}

.logo {
height:114px;
width:240px;
float:left;
}

.logo_pad {
padding-top:95px;
}

#header_search {
float:right;
}

.header_search_pad {
padding-top:40px;
}

.topmenu {
height:90px;
margin:0 auto;
}

#topmenu_pad {
padding:0px 4px 0px 4px;
float:right;
}

.header_module {
overflow:hidden;
margin:0 auto;
height:164px;
}

.path {
margin:0 auto;
padding-bottom:10px;
}

.path_pad {
}

.main_area {
margin:0 auto;
}

.content_wrap {
margin-top:13px;
float:left;
}

.content_pad {
padding:0;
}

.column_left {
float:left;
}

.column_right {
float:right;
}

.column_right_pad {
padding-left:15px;
}

.column_left_pad {
padding-right:15px;
}

.module_inset,.module_toolbar {
padding-bottom:30px;
}

.upper {
margin:0 auto;
padding:40px 10px 15px 10px;
}

.bottom {
padding:10px;
margin:15px auto 20px auto;
}

.modulerow1 {
width:99.9%;
float:left;
}

.modulerow2 {
width:49.9%;
float:left;
}

.modulerow3 {
width:33.3%;
float:left;
}

.modulerow4 {
width:24.9%;
float:left;
}

.footer_wrap {
margin:0 20px;
background: url(../images/content_bg2.png);
}

.footer_content {
margin:0 auto;
padding:15px 0;
}

.footer_modules {
padding:0 10px;
}

.footer_wrap_copyright {
padding:5px 0 25px 0;
}

.footer_wrap_copyright_content {
margin:0 auto;
padding:0 10px;
}

.footer {
width:50%;
float:left;
color:#555555;
}

.footer2 {
width:50%;
float:left;
text-align:center;
color:#555555;
}

.footer_wrap_copyright a:link, .footer_wrap_copyright a:visited {
color:#555555;
font-weight:normal;
}

.footer_pad {
padding:5px 10px;
}

.clr {
clear:both;
}

#font_resize {
float:right;
padding-top:1px;
padding-right:30px;
}

#font_resize a {
padding:0 5px;
font-weight:normal;
}

Отправлено: 14:01, 09-02-2013

 


Компьютерный форум OSzone.net » Компьютеры + Интернет » Вебмастеру » Как выставить фотографии по центру

Участник сейчас на форуме Участник сейчас на форуме Участник вне форума Участник вне форума Автор темы Автор темы Шапка темы Сообщение прикреплено

Похожие темы
Название темы Автор Информация о форуме Ответов Последнее сообщение
Интерфейс - Черный экран и курсор по центру antisept Microsoft Windows 2000/XP 6 17-08-2018 10:00
Интерфейс - Выровнить картинку по центру Mikk15 Microsoft Windows 2000/XP 6 21-04-2012 21:03
[решено] Выравниевание текста по центру в GUICtrlCreateLabel Centrinar AutoIt 1 17-04-2010 18:49
Драйвер - Как выставить в драйвере Nvidia формат сигнала PAL по умолчанию drezina Microsoft Windows 7 0 17-10-2009 17:32
Интерфейс - [решено] как выставить по умолчанию переключить в вык.комп apareka Microsoft Windows Vista 3 02-03-2009 16:37




 
Переход