Jump to content
  • 0

отображение в разных браузерах


dts
 Share

Question

Проблема вот в чем: на сайт (prisvete.ru) поставил блок с выводом топ новостей, при наведении на которую(картинку-новость), показывает ее название, но в мазиле вроде все нормально,а вот в хроме (на других браузерах не пробовал) название появляется с боку, не наводя на нее,тем самым отодвигая картинку-новость на длину названия, тем самым портя весь вид.Подскажите как это можно исправить.

вот PHP код новости:

<?php 
$sql_result = $db->query( "SELECT id, title, date, alt_name, category, short_story, flag FROM " . PREFIX . "_post WHERE approve='1' ORDER BY date DESC LIMIT 10" );
while ( $row = $db->get_row()){$row['date'] = strtotime( $row['date'] );
$row['category'] = intval( $row['category'] );
if( $config['allow_alt_url'] == "yes")
{
if( $row['flag'] and $config['seo_type'])
{
if( $row['category'] and $config['seo_type'] == 2 )
{
$full_link = $config['http_home_url'] . get_url( $row['category'] ) . "/" . $row['id'] . "-" . $row['alt_name'] . ".html";
}
else{$full_link = $config['http_home_url'] . $row['id'] . "-" . $row['alt_name'] . ".html";
}
}
else
{
$full_link = $config['http_home_url'] . date( 'Y/m/d/', $row['date'] ) . $row['alt_name'] . ".html";
}
}
else{$full_link = $config['http_home_url'] . "index.php?newsid=" . $row['id'];
}
$title = substr( $row['title'], 0, 20 ) . "...";$short_story = substr( strip_tags($row['short_story']), 0, 20 )."...";

$shortnews = $row['short_story'];

preg_match_all( '#<img[^>]*\\ssrc=(\'|")(.*?)\\1.*?>#i',$shortnews,$total);

foreach( $total[2] as $image )

echo('

<a class="tooltip" href="'.$full_link.'" ><img align="center" src="'.$image.'" width="108" height="150" ><span>'.$title.'<small></small></span></a>')

;}
?>

а вот CSS к нему:

.tooltip { position: relative; }
.tooltip span {
position: relative;
right: 0;
top: 20px;
display: none;


padding: 3px 8px;
white-space: nowrap;
font-size: 14px;
font-weight:500;
text-align: right;
background-color: #FFFFAA;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
color: #000;
border: 1px solid #FFAD33;
}
.tooltip span small {
position: relative;
right: 10px;
bottom: -6px;
border-top: 6px solid rgba(0,0,0,.8);
border-left: 6px solid transparent;
}
.tooltip:hover span { display: block; }

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Сразу же совет: если устраняете проблему в верстке — смотрите на итоговый HTML, который PHP выдает браузеру, а не на PHP-исходник. Если у вас проблема, отчего котлеты оказались с одного бока подгоревшими — самый придирчивый анализ сырого фарша едва ли поможет ее решению :)

Link to comment
Share on other sites

  • 0

Копируйте сюда не код PHP-исходника, а то, что показывает браузер во "View Source" ("Показать исходный код") проблемной страницы.

А вообще для понимания того, где, как и что делает PHP, крайне полезно очень внимательно прочитать эту страницу. И вообще весь этот сайт (не обязательно сразу, но и откладывать не стоит).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy