我创建了一个带有imgs链接的页面 它在chrome上的工作很棒,但我遇到了chrome和firefox的问题。网站的其余部分完美地工作只有这个区域在3网页浏览器中不准确。 我试图在这里和网上搜索,但无法找到任何帮助 http://saggiehaim.net/YSD/projects.html 这是有问题的页面。 正如你可以看到,与其他两个
不同,它的工作效果很好感谢您的时间和亲切的帮助!
这是我的代码:
#pro {
width:960px;
display:block;
margin:0 auto;
}
#pro ul {
width:100%;
margin: 0 auto;
text-align: center;
}
#pro li {
width:33%;
display: inline-block;
margin:40px 0;
}
#pro img {
width:204px;
height:204px;
-webkit-box-shadow: 0px 0px 53px 16px rgba(164,207,56,0.29);
-moz-box-shadow: 0px 0px 53px 16px rgba(164,207,56,0.29);
-ms-box-shadow: 0px 0px 53px 16px rgba(164,207,56,0.29);
box-shadow: 0px 0px 53px 16px rgba(164,207,56,0.29);
border: 5px solid white;
}
#pro img:hover
{
-webkit-box-shadow: 0px 0px 40px 16px rgba(0,51,23,1);
-moz-box-shadow: 0px 0px 40px 16px rgba(0,51,23,1);
-ms-box-shadow: 0px 0px 40px 16px rgba(0,51,23,1);
box-shadow: 0px 0px 40px 16px rgba(0,51,23,1);
}
#pro h1 {
display: table-cell;
padding:2px;
background-color:#FFF;
font-size: 1.5em;
position: relative;
top: -40px;
right:-98px;
width: 204px;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
opacity:0;
color:#060;
}
#pro li:hover h1 {
-moz-transform: translateX(-43px);
-webkit-transform: translateX(-34px);
-ms-transform: translateX(-43px);
transform: translateX(-43px);
opacity:1;
}
#pro h2 {
margin-top:-55px;
}
#pro a {
text-decoration:none;
}
<div id="pro">
<ul>
<li>
<a href="projects/project1/pro1.html"><img src="img/prv1.jpg" alt="project 1"><h1>הכנס לפרוייקט</h1><br><h2>פרוייקט לדוגמא</h2></a></li>
<li>
<a href="projects/project2/pro2.html"><img src="img/prv1.jpg" alt="project 1"><h1>הכנס לפרוייקט</h1><br><h2>פרוייקט לדוגמא</h2></a>
</li>
<li>
<a href="projects/project3/pro3.html"><img src="img/prv1.jpg" alt="project 1"><h1>הכנס לפרוייקט</h1><br><h2>פרוייקט לדוגמא</h2></a>
</li>
<li>
<a href="projects/project4/pro4.html"><img src="img/prv1.jpg" alt="project 1"><h1>הכנס לפרוייקט</h1><br><h2>פרוייקט לדוגמא</h2></a>
</li>
<li>
<a href="projects/project5/pro5.html"><img src="img/prv1.jpg" alt="project 1"><h1>הכנס לפרוייקט</h1><br><h2>פרוייקט לדוגמא</h2></a>
</li>
<li>
<a href="projects/project6/pro6.html"><img src="img/prv1.jpg" alt="project 1"><h1>הכנס לפרוייקט</h1><br><h2>פרוייקט לדוגמא</h2></a>
</li>
<li>
<a href="projects/project7/pro7.html"><img src="img/prv1.jpg" alt="project 1"><h1>הכנס לפרוייקט</h1><br><h2>פרוייקט לדוגמא</h2></a>
</li>
<li>
<a href="projects/project8/pro8.html"><img src="img/prv1.jpg" alt="project 1"><h1>הכנס לפרוייקט</h1><br><h2>פרוייקט לדוגמא</h2></a>
</li>
<li>
<a href="projects/project9/pro9.html"><img src="img/prv1.jpg" alt="project 1"><h1>הכנס לפרוייקט</h1><br><h2>פרוייקט לדוגמא</h2></a>
</li>
</ul>
</div>
答案 0 :(得分:1)
包含/更新以下css以完成它!
注意:我已从ID display:table-cell; padding:2px;
中删除了#pro h1
。
CSS:
h1, h2, ul, li{
margin:0;
padding:0;
}
#pro h1 {
background-color: #FFF;
font-size: 1.5em;
position: relative;
top: -80px;
right: -88px;
width: 204px;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-ms-rransition: all 300ms ease-out;
transition: all 300ms ease-out;
opacity: 0;
color: #060;
}
答案 1 :(得分:0)
我可以看到的一件事是,在你的#pro h1 id属性中,你拼错了“过渡”这个词。你写过:
-ms-rransition: all 300ms ease-out;
应该说:
-ms-transition: all 300ms ease-out;
谷歌浏览器可能足够智能以获取错误,而其他浏览器可能不会。首先尝试修复它,看看它是否有帮助。
答案 2 :(得分:0)
I have changed CSS and it works perfect on Mozilla as well on Chrome.
I hope this will help you.
#pro {
width:960px;
display:block;
margin:0 auto;
}
#pro ul {
width:100%;
margin: 0 auto;
text-align: center;
}
#pro li {
width:33%;
display: inline-block;
margin:40px 0;
position:relative;
}
#pro img {
width:204px;
height:204px;
-webkit-box-shadow: 0px 0px 53px 16px rgba(164,207,56,0.29);
-moz-box-shadow: 0px 0px 53px 16px rgba(164,207,56,0.29);
-ms-box-shadow: 0px 0px 53px 16px rgba(164,207,56,0.29);
box-shadow: 0px 0px 53px 16px rgba(164,207,56,0.29);
border: 5px solid white;
}
#pro img:hover
{
-webkit-box-shadow: 0px 0px 40px 16px rgba(0,51,23,1);
-moz-box-shadow: 0px 0px 40px 16px rgba(0,51,23,1);
-ms-box-shadow: 0px 0px 40px 16px rgba(0,51,23,1);
box-shadow: 0px 0px 40px 16px rgba(0,51,23,1);
}
#pro h1 {
display: table-cell;
padding:2px;
background-color:#FFF;
font-size: 1.5em;
position: absolute;
top: 199px;
right:0px;
width: 204px;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
opacity:0;
color:#060;
}
#pro li:hover h1 {
-moz-transform: translateX(-43px);
-webkit-transform: translateX(-34px);
-ms-transform: translateX(-43px);
transform: translateX(-43px);
opacity:1;
}
#pro h2 {
margin-top:-55px;
}
#pro a {
text-decoration:none;
float:left;
}
答案 3 :(得分:0)
将显示块添加到此类
#pro a {
display: block; /*** new added***/
text-decoration: none;
}
并添加图像并在div中滑动h1