Форум: Форум PHPФорум ApacheФорум Регулярные ВыраженияФорум MySQLHTML+CSS+JavaScriptФорум FlashРазное
Новые темы: 0000000
C++. Мастер-класс в задачах и примерах. Авторы: Кузнецов М.В., Симдянов И.В. PHP 5/6. В подлиннике. Авторы: Кузнецов М.В., Симдянов И.В. MySQL на примерах. Авторы: Кузнецов М.В., Симдянов И.В. MySQL 5. В подлиннике. Авторы: Кузнецов М.В., Симдянов И.В. Программирование. Ступени успешной карьеры. Авторы: Кузнецов М.В., Симдянов И.В.
ВСЕ НАШИ КНИГИ
Консультационный центр SoftTime

HTML+CSS+JavaScript

Выбрать другой форум

 

Здравствуйте, Посетитель!

вид форума:
Линейный форум Структурный форум

тема: Прыгающие "Хлебные крошки"
 
 автор: Владимир55   (29.12.2013 в 01:32)   письмо автору
1.4 Кб
 
 

Навигация по сайту осуществляется с помощью типового XSL шаблона, не имеющего стилей внутри себя. :

<style>
/* ХЛЕБНЫЕ КРОШКИ  */
.navigation {
   font-family: Arial, Helvetica, sans-serif;
   font-size: 100%;
   margin: 20px 0 20px 0;
   padding-left: 1%;
   font-weight: normal;
   color: #6c7b3d;
}

.navigation a {
   font-family: Arial, Helvetica, sans-serif;
   font-size: 100%;
   color: #6c7b3d;
}

</style>


<div class="navigation">
<?php
// Вывод строки навигации
$Structure_Controller_Breadcrumbs = new Structure_Controller_Breadcrumbs(
        
Core_Entity::factory('Site'CURRENT_SITE)
    );
$Structure_Controller_Breadcrumbs
    
->xsl(
        
Core_Entity::factory('Xsl')->getByName('ХлебныеКрошки')
    )
    ->
show();
?>
</div>


А получается, что название открытой страницы подпрыгивает вверх (скриншот).


И ничего с этим поделать не удается!!!

Почему так?

  Ответить  
 
 автор: Deed   (29.12.2013 в 10:16)   письмо автору
 
   для: Владимир55   (29.12.2013 в 01:32)
 

Какой идентификатор у "Миссия"?
"Миссия" в каком теге?
Какой смысл лепить картинку вместо фрагмента кода?

  Ответить  
 
 автор: Владимир55   (29.12.2013 в 10:31)   письмо автору
 
   для: Deed   (29.12.2013 в 10:16)
 

Я привел все коды, какие имеют место быть. Никаких иных идентификаторов и тегов нет. Если же посмотреть код в браузере, то получаем вот что:

<div class="navigation">
<a href="/">Главная</a>
<span> &#8594; </span>
Миссия
</div>

  Ответить  
 
 автор: Deed   (29.12.2013 в 11:01)   письмо автору
 
   для: Владимир55   (29.12.2013 в 10:31)
 

Значит, нужно "Миссия" выводить в спан.
Как-нибудь так:

<style>
.here{
    position:relative;
    top: 2px; /*подобрать опытным путем*/
}
</style>

<div class="navigation">
<a href="/">Главная</a>
<span> &#8594; </span>
<span class="here">Миссия</span>
</div>

  Ответить  
 
 автор: Владимир55   (29.12.2013 в 11:20)   письмо автору
 
   для: Deed   (29.12.2013 в 11:01)
 

Похоже, что с этими "прыжками" придется смириться - вот код самого шаблона: ну как тут хоть что-нибудь можно вставить?

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    <xsl:output xmlns="http://www.w3.org/TR/xhtml1/strict" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="utf-8" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
    
    <!-- Хлебные крошки -->
    
    <xsl:template match="/site">
        <xsl:if test="count(*[@id]) &gt; 0">
            <a href="/">Главная</a>
            <xsl:apply-templates select="*[@id]" />
        </xsl:if>
    </xsl:template>
    
    <xsl:template match="*">
        
        <!-- Определяем адрес ссылки -->
        <xsl:variable name="link">
            <xsl:choose>
                <!-- Если внутренняя ссылка -->
                <xsl:when test="link != ''">
                    <xsl:value-of disable-output-escaping="yes" select="link"/>
                </xsl:when>
                <!-- Если внешняя ссылка -->
                <xsl:otherwise>
                    <xsl:value-of disable-output-escaping="yes" select="url"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        
    <span><xsl:text> &#8594; </xsl:text></span>
        
        <!-- Показывать ссылку? -->
        <xsl:choose>
            <xsl:when test="(show = 1 or active/node() and active = 1) and count(*[@id][link/node() or url/node()]) &gt; 0">
                <a href="{$link}">
                    <xsl:value-of disable-output-escaping="yes" select="name"/>
                </a>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of disable-output-escaping="yes" select="name"/>
            </xsl:otherwise>
        </xsl:choose>
        
        <xsl:apply-templates select="*[@id][link/node() or url/node()]" />
        
    </xsl:template>
</xsl:stylesheet>

  Ответить  
 
 автор: Владимир55   (30.12.2013 в 14:36)   письмо автору
 
   для: Владимир55   (29.12.2013 в 11:20)
 

Как можно предположить, реальная причина искажения строки в каких-то наложенных стилях, то есть в их наследовании.

Чтобы попытаться это увидеть, в Хроме жму Ф12 и получаю в правой части экрана список, в котором ничего невозможно понять...

 element.style {
}
.navigation {
font-family: Arial, Helvetica, sans-serif;
font-size: 100%;
font-weight: normal;
color: #6c7b3d;
}
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
vertical-align: middle;
background: transparent;
font: 15px Arial,sans-serif;
}
user agent stylesheetdiv {
display: block;
}
Inherited from li#Right_column
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
font: 15px Arial,sans-serif;
}
user agent stylesheetli {
text-align: -webkit-match-parent;
}
Inherited from ul
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
font: 15px Arial,sans-serif;
}
user agent stylesheetul, menu, dir {
list-style-type: disc;
}
Inherited from div#string_content
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
font: 15px Arial,sans-serif;
}
Inherited from div#Content
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
font: 15px Arial,sans-serif;
}
Inherited from div#Contour_page
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
font: 15px Arial,sans-serif;
}
Inherited from body
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
font: 15px Arial,sans-serif;
}
Inherited from html
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
font: 15px Arial,sans-serif;
 
 


Если же посмотреть Сomputed, то увидим вот что:

-webkit-background-clip: border-box;
-webkit-background-origin: padding-box;
-webkit-background-size: auto;
background-attachment: scroll;
background-clip: border-box;
background-color: rgba(0, 0, 0, 0);
background-image: url(/my-design/fone.gif);
background-origin: padding-box;
background-size: auto;
border-bottom-color: rgb(0, 0, 0);
border-bottom-style: none;
border-bottom-width: 0px;
border-image-outset: 0px;
border-image-repeat: stretch;
border-image-slice: 100%;
border-image-source: none;
border-image-width: 1;
border-left-color: rgb(0, 0, 0);
border-left-style: none;
border-left-width: 0px;
border-right-color: rgb(0, 0, 0);
border-right-style: none;
border-right-width: 0px;
border-top-color: rgb(0, 0, 0);
border-top-style: none;
border-top-width: 0px;
display: block;
font-family: Arial, sans-serif;
font-size: 15.555556297302246px;
font-style: normal;
font-variant: normal;
font-weight: normal;
height: 1646.3367919921875px;
line-height: normal;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
outline-color: rgb(0, 0, 0);
outline-style: none;
outline-width: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
vertical-align: middle;
width: 1114.4444580078125px;
font-family:Arial, sans-serif;

Во-первых, непонятно что такое webkit - такого стиля я не задавал.

А во-вторых, тут я не вижу ответа на основной вопрос - строка-то почему ломается?

  Ответить  
 
 автор: Владимир55   (30.12.2013 в 16:38)   письмо автору
 
   для: Владимир55   (30.12.2013 в 14:36)
 

Проблема разрешилась, спасибо!

  Ответить  
Rambler's Top100
вверх

Rambler's Top100 Яндекс.Метрика Яндекс цитирования