- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在制作一个网站模板,我与您联系是因为我无法弄清楚问题出在哪里。
如果你在 google chrome 上检查它,搜索结果栏 ( <ul></ul>
) 下的图像(在 #results
.resultbar
内)对齐得很好,但在 firefox 和 IE 上它看起来很奇怪,好像有是第一张图片的左边距,因此所有图片都被置换了。
我把所有的代码都贴在这里,下面有一个codepen链接:
<body>
<header>
<div id="top-header">
<a href="#" id="logo"></a>
<nav>
<ul>
<a href='#' class='menu-link'><li>Videos</li></a>
<a href='#' class='menu-link'><li>Categories</li></a>
</ul>
<a href="#" id="menu-icon"></a>
</nav>
</div>
<div id="down-header">
<div id="form-container">
<!--<input type="submit" id="searchsubmit" value="" />-->
<a class="search-submit-button" href="javascript:search()">
<i class="fa fa-search"></i>
</a>
<div id="searchtext">
<input type="text" id="s" name="s" placeholder="Search 1000’s of videos...">
</div>
</div>
<div id="form-filter">
<input class="labeled-checkbox" type="checkbox" id="hd">
<label for="hd" id="hd-checkbox">
<span class="labeled-checkbox-unchecked">HD ONLY</span>
<span class="labeled-checkbox-checked">HD ONLY</span>
</label>
<div class="lenght-filter">
<input type="radio" id="radio1" name="radios" value="short">
<label for="radio1">SHORT</label>
<input type="radio" id="radio2" name="radios" value="long">
<label for="radio2">LONG</label>
<input type="radio" id="radio3" name="radios" value="all" checked>
<label for="radio3">ALL VIDEOS</label>
</div>
</div>
</div>
</header>
<div id="content">
<div class="resultbar">
<h1>300000 results for "lol"</h1>
<!-- Sub menu dropdown -->
<ul class="order-filter">
<li>
<span>Date added</span> <i class="fa fa-caret-down"></i>
<ul>
<li>Relevance</li>
<li>Duration</li>
<li>Date added <i class="fa fa-check"></i></li>
</ul>
</li>
</ul>
<!-- /Sub menu dropdown -->
</div>
<ul class="cbp-rfgrid" id="results">
<li>
<a href="#"><img src="http://example.com/tcimages/pm5544.jpg" />
<div>
<h3>Felis catus</h3>
</div>
</a>
</li>
<li>
<a href="#"><img src="http://example.com/tcimages/pm5544.jpg" />
<div>
<h3>Felis catus</h3>
</div>
</a>
</li>
<li>
<a href="#"><img src="http://example.com/tcimages/pm5544.jpg" />
<div>
<h3>Felis catus</h3>
</div>
</a>
</li>
<li>
<a href="#"><img src="http://example.com/tcimages/pm5544.jpg" />
<div>
<h3>Felis catus</h3>
</div>
</a>
</li>
<li>
<a href="#"><img src="http://example.com/tcimages/pm5544.jpg" />
<div>
<h3>Felis catus</h3>
</div>
</a>
</li>
<li>
<a href="#"><img src="http://example.com/tcimages/pm5544.jpg" />
<div>
<h3>Felis catus</h3>
</div>
</a>
</li>
<li>
<a href="#"><img src="http://example.com/tcimages/pm5544.jpg" />
<div>
<h3>Felis catus</h3>
</div>
</a>
</li>
<li>
<a href="#"><img src="http://example.com/tcimages/pm5544.jpg" />
<div>
<h3>Felis catus</h3>
</div>
</a>
</li>
<!-- ... -->
</ul>
</div>
</body>
这里是css
body {
margin: 0;
width: 100%;
height: 100%;
background: black;
}
a {
color: #F4BEFF;
text-decoration: none;
font-weight: bold;
}
a:hover {
color: #444;
}
img {
width: 100%;
}
header {
background: url('http://i.imgur.com/RKLjC33.png') repeat scroll #303030;
height: 192px;
border-bottom: 4px solid #151515;
z-index: 100;
min-width: 300px;
position: fixed;
width: 100%;
}
#top-header {
height: 100px;
padding-left: 10%;
padding-right: 10%;
}
#down-header {
padding-left: 10%;
padding-right: 10%;
background: #28282a;
border-top: 4px solid #151515;
padding-top: 5px;
}
#content {
padding-left: 10%;
padding-right: 10%;
position: absolute;
top: 196px;
width: 80%;
}
#logo {
float: left;
width: 195px;
height: 100%;
display: block;
font-size: 20px;
font-weight: bold;
line-height: 80px;
letter-spacing: 4px;
background: transparent url('http://www.eventbrite.com/custombutton?eid=2482178262') no-repeat;
background-position: center;
}
@media screen and (max-width: 1200px) {
#top-header {
height: 100px;
padding-left: 10px;
padding-right: 10px;
}
#down-header {
padding-left: 10px;
padding-right: 5px;
}
#content {
padding-left: 10px;
padding-right: 10px;
width: -webkit-calc(100% - 20px);
width: calc(100% - 20px);
}
}
nav {
float: right;
padding: 20px;
}
.ad {
text-align: center;
margin-top: 200px;
}
#menu-icon {
display: none;
float: right;
width: 40px;
height: 60px;
background: url(../images/menu-icon.png) no-repeat center;
}
a:hover#menu-icon {
background-color: #444;
border-radius: 4px 4px 0 0;
}
ul {
list-style: none;
}
li {
display: inline-block;
float: left;
padding: 10px;
color: #BBB;
font-weight: bold;
/* font-size: 16px; */;
}
.current {
color: #2262AD;
}
section {
margin: 80px auto 40px;
max-width: 980px;
position: relative;
padding: 20px;
}
/*MEDIA QUERY*/
@media only screen and (max-width : 640px) {
header {
/*position: absolute;*/;
}
#menu-icon {
display: inline-block;
}
nav ul, nav:active ul {
display: none;
position: absolute;
padding: 20px;
background: #fff;
border: 5px solid #444;
right: 20px;
top: 60px;
width: 50%;
border-radius: 4px 0 4px 4px;
}
nav li {
text-align: center;
width: 100%;
padding: 10px 0;
margin: 0;
}
nav:hover ul {
display: block;
}
}
/*Search bar */
/*import font awesome css icon library*/
#s {
background: none repeat scroll 0 0 #fafafa;
border: 1px solid #eeeeee;
color: #5e5e5e;
display: block;
font-family: arial, sans-serif;
font-size: inherit;
padding: 10px;
width: 100%;
box-sizing: border-box;
font-size: 16px;
margin: 0;
height: 40px;
}
#searchtext {
overflow: hidden;
background: #28282a;
}
a.search-submit-button {
background: none repeat scroll 0 0 #EF7896;
border-bottom: 1px solid #eeeeee;
border-right: 1px solid #eeeeee;
border-top: 1px solid #eeeeee;
color: #5e5e5e !important;
display: block;
float: right;
font-family: inherit;
font-size: 20px;
padding: 8px 10px;
text-align: center;
width: 45px;
box-sizing: border-box;
height: 40px;
}
#form-container {
min-width: 290px;
z-index: 9999;
/* width: 100%; */;
}
#form-filter {
height: 38px;
background-color: #28282a;
width: 100%;
padding-top: 5px;
min-width: 290px;
z-index: 9999;
}
.lenght-filter {
float: right;
margin-right: 3px;
font-size: 11px;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
margin-top: 3px;
}
.hd-filter {
float: left;
margin-left: 25px;
}
#results {
/* margin-top: 163px; */;
}
/*responsive*/
#results li {
/* padding: 0; */;
}
.cbp-rfgrid {
position: relative;
padding: 0;
margin: 0;
list-style: none;
width: 100%;
}
.cbp-rfgrid li {
position: relative;
float: left;
overflow: hidden;
width: 20%;
/* Fallback */
width: -webkit-calc(100% / 5);
width: calc(90% / 5);
padding: 1%;
}
.cbp-rfgrid li a,
.cbp-rfgrid li a img {
display: block;
width: 100%;
cursor: pointer;
}
.cbp-rfgrid li a img {
max-width: 100%;
margin-bottom: -10%;
margin-top: -10%;
}
/* Flexbox is used for centering the heading */
.cbp-rfgrid li a div {
position: absolute;
left: 20px;
top: 20px;
right: 20px;
bottom: 20px;
background: rgba(71,163,218,0.2);
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: flex;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
text-align: center;
opacity: 0;
}
.cbp-rfgrid li a:hover div {
opacity: 1;
}
.cbp-rfgrid li a div h3 {
width: 100%;
color: #fff;
text-transform: uppercase;
font-size: 1.4em;
letter-spacing: 2px;
padding: 0 10px;
}
/* Example for media query: change number of items per row */
@media screen and (max-width: 1190px) {
.cbp-rfgrid li {
width: 23%;
/* Fallback */
width: -webkit-calc(92% / 4);
width: calc(92% / 4);
padding: 1%;
}
}
@media screen and (max-width: 945px) {
.cbp-rfgrid li {
width: 31.3333333%;
/* Fallback */
width: -webkit-calc(94% / 3);
width: calc(94% / 3);
padding: 1%;
}
}
@media screen and (max-width: 660px) {
.cbp-rfgrid li {
width: 48%;
/* Fallback */
width: -webkit-calc(96% / 2);
width: calc(96% / 2);
padding: 1%;
}
}
@media screen and (max-width: 400px) {
.cbp-rfgrid li {
width: 98%;
/* Fallback */
width: -webkit-calc(98% / 1);
width: calc(98% / 1);
padding: 1%;
}
}
@media screen and (max-width: 305px) {
.cbp-rfgrid li {
width: 98%;
padding: 1%;
}
}
.menu-link li {
color: #BBB;
text-decoration: none;
font-family: Arial, sans-serif;
font-weight: normal;
font-size: larger;
}
.menu-link:hover li {
color: #FFF;
}
.resultbar {
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #333537), color-stop(100%, #1e1e1f));
background: -moz-linear-gradient(bottom, #1e1e1f 0%, #272729 97.56%, #333537 100%);
background: -o-linear-gradient(bottom, #1e1e1f 0%, #272729 97.56%, #333537 100%);
background: -webkit-linear-gradient(bottom, #1e1e1f 0%, #272729 97.56%, #333537 100%);
background: linear-gradient(bottom, #1e1e1f 0%, #272729 97.56%, #333537 100%);
height: 38px;
margin-top: 5px;
}
.resultbar h1 {
font-size: 16px;
font-weight: bold;
float: left;
white-space: nowrap;
font-family: Arial, sans-serif;
color: white;
padding: 10px;
margin: 0;
}
/*SearchBar design */
.order-filter {
text-align: left;
display: inline;
margin: 0;
list-style: none;
float: right;
padding: 0;
}
.order-filter li {
font: 12px/18px sans-serif;
display: inline-block;
position: relative;
cursor: pointer;
background: #4f4f4f;
background: -moz-linear-gradient(bottom, #393939 0%, #4f4f4f 97.56%, #636466 100%);
background: -o-linear-gradient(bottom, #393939 0%, #4f4f4f 97.56%, #636466 100%);
background: -webkit-linear-gradient(bottom, #393939 0%, #4f4f4f 97.56%, #636466 100%);
background: linear-gradient(bottom, #393939 0%, #4f4f4f 97.56%, #636466 100%);
padding: 4px;
color: white;
margin-top: 6px;
width: 85px;
margin-right: 5px;
}
.order-filter li:hover {
color: #fff;
}
.order-filter li ul {
z-index: 10000;
padding: 0;
position: absolute;
top: 26px;
left: 0;
width: 85px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
}
.order-filter li ul li {
display: block;
color: #fff;
text-shadow: 0 -1px 0 #000;
width: 83px;
margin: 0;
background: #1a1a1c;
border-bottom: 1px solid #373737;
border-left: 1px solid #373737;
border-right: 1px solid #373737;
}
.order-filter li ul li:hover {
color: #ee577c;
}
.order-filter li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
.order-filter li i {
float: right;
margin-top: 2px;
}
/*
* CSS Labeled Checkbox
*
* @author: Francisco Neves
* @site: www.francisconeves.com
*/
/** Reset */
* { outline: none !important; }
a, a:visited, a:hover, a:active { text-decoration: none; color: inherit; }
/**
* ==== Custom Labeled Checkboxes ====
*/
/** Fonts */
@font-face
{
font-family: 'open_sans_lightregular';
src: url('../fonts/opensans-light-webfont.eot');
src: url('../fonts/opensans-light-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/opensans-light-webfont.woff') format('woff'),
url('../fonts/opensans-light-webfont.ttf') format('truetype'),
url('../fonts/opensans-light-webfont.svg#open_sans_lightregular') format('svg');
font-weight: 800;
font-style: normal;
}
@font-face
{
font-family: 'open_sans_semiboldregular';
src: url('../fonts/opensans-semibold-webfont.eot');
src: url('../fonts/opensans-semibold-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/opensans-semibold-webfont.woff') format('woff'),
url('../fonts/opensans-semibold-webfont.ttf') format('truetype'),
url('../fonts/opensans-semibold-webfont.svg#open_sans_semiboldregular') format('svg');
font-weight: normal;
font-style: normal;
}
/** Freebie */
input[type=checkbox].labeled-checkbox
{
display: none !important;
}
input[type=checkbox].labeled-checkbox + label
{
display: table;
max-width: 170px;
font-size: 11px;
padding: 10px;
background:#373737 url('../images/pagination-gradient-x.png') repeat-x;
color: #a7a7a7;
cursor: pointer;
border-radius: 1px 1px 1px 1px;
-moz-border-radius: 1px 1px 1px 1px;
-webkit-border-radius: 1px 1px 1px 1px;
transition: background-color 200ms;
-moz-transition: background-color 200ms;
-webkit-transition: background-color 200ms;
-o-transition: background-color 200ms;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
}
input[type=checkbox].labeled-checkbox.icon + label
{
width: auto;
}
input[type=checkbox].labeled-checkbox + label > span.labeled-checkbox-unchecked
{
background: url( ../images/checkbox-unchecked.png ) no-repeat left center;
padding-left: 20px;
}
input[type=checkbox].labeled-checkbox + label > span.labeled-checkbox-checked
{
background: url( ../images/checkbox-checked.png ) no-repeat left center;
padding-left: 20px;
}
input[type=checkbox].labeled-checkbox.icon + label > span.labeled-checkbox-unchecked
{
display: block;
background-position: center;
width: 16px;
height: 16px;
padding-left: 0;
}
input[type=checkbox].labeled-checkbox.icon + label > span.labeled-checkbox-checked
{
display: block;
background-position: center;
width: 16px;
height: 16px;
padding-left: 0;
}
input[type=checkbox].labeled-checkbox + label ::selection
{
background-color: rgba(255, 255, 255, 0);
}
input[type=checkbox].labeled-checkbox + label ::-moz-selection
{
background-color: rgba(255, 255, 255, 0);
}
input[type=checkbox].labeled-checkbox + label:hover
{
background-color: #EF7896;
color: #ffffff;
}
input[type=checkbox].labeled-checkbox:not(:checked) + label > span.labeled-checkbox-checked
{
display: none;
}
/* When Checked */
input[type=checkbox].labeled-checkbox:checked + label
{
background: #EF7896;
color: #ffffff;
}
input[type=checkbox].labeled-checkbox:checked + label:hover
{
background-color: #EF7896;
}
input[type=checkbox].labeled-checkbox:checked + label > span.labeled-checkbox-unchecked
{
display: none;
}
input[type=checkbox].labeled-checkbox:checked + label > span.labeled-checkbox-checked
{
display: inline;
}
input[type=checkbox].labeled-checkbox.icon:checked + label > span.labeled-checkbox-checked
{
display: block;
}
#hd-checkbox{
float: left;
font-family: 'Open Sans', sans-serif;
}
/*
Hide radio button (the round disc)
we will use just the label to create pushbutton effect
*/
input[type=radio] {
display:none;
margin:10px;
}
/*
Change the look'n'feel of labels (which are adjacent to radiobuttons).
Add some margin, padding to label
*/
input[type=radio] + label {
display:inline-block;
margin:-3px;
padding:10px;
background:#373737 url('../images/pagination-gradient-x.png') repeat-x;
border-color: #ddd;
color: #ffffff;
}
/*
Change background color for label next to checked radio button
to make it look like highlighted button
*/
input[type=radio]:checked + label {
background: #EF7896;
color: #ffffff;
}
label{
cursor:pointer;
}
这是一个代码笔链接,您可以查看:http://codepen.io/anon/pen/xoprg
谢谢
最佳答案
问题源于 resultbar
中的 float 未被清除。
最简单的解决方法是将 overflow: hidden;
添加到 .resultbar
.resultbar {
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #333537), color-stop(100%, #1e1e1f));
background: -moz-linear-gradient(bottom, #1e1e1f 0%, #272729 97.56%, #333537 100%);
background: -o-linear-gradient(bottom, #1e1e1f 0%, #272729 97.56%, #333537 100%);
background: -webkit-linear-gradient(bottom, #1e1e1f 0%, #272729 97.56%, #333537 100%);
background: linear-gradient(bottom, #1e1e1f 0%, #272729 97.56%, #333537 100%);
height: 38px;
margin-top: 5px;
overflow: hidden;
}
关于html - CSS - 在 Firefox 和 IE 中呈现不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26475532/
我需要将文本放在 中在一个 Div 中,在另一个 Div 中,在另一个 Div 中。所以这是它的样子: #document Change PIN
奇怪的事情发生了。 我有一个基本的 html 代码。 html,头部, body 。(因为我收到了一些反对票,这里是完整的代码) 这是我的CSS: html { backgroun
我正在尝试将 Assets 中的一组图像加载到 UICollectionview 中存在的 ImageView 中,但每当我运行应用程序时它都会显示错误。而且也没有显示图像。 我在ViewDidLoa
我需要根据带参数的 perl 脚本的输出更改一些环境变量。在 tcsh 中,我可以使用别名命令来评估 perl 脚本的输出。 tcsh: alias setsdk 'eval `/localhome/
我使用 Windows 身份验证创建了一个新的 Blazor(服务器端)应用程序,并使用 IIS Express 运行它。它将显示一条消息“Hello Domain\User!”来自右上方的以下 Ra
这是我的方法 void login(Event event);我想知道 Kotlin 中应该如何 最佳答案 在 Kotlin 中通配符运算符是 * 。它指示编译器它是未知的,但一旦知道,就不会有其他类
看下面的代码 for story in book if story.title.length < 140 - var story
我正在尝试用 C 语言学习字符串处理。我写了一个程序,它存储了一些音乐轨道,并帮助用户检查他/她想到的歌曲是否存在于存储的轨道中。这是通过要求用户输入一串字符来完成的。然后程序使用 strstr()
我正在学习 sscanf 并遇到如下格式字符串: sscanf("%[^:]:%[^*=]%*[*=]%n",a,b,&c); 我理解 %[^:] 部分意味着扫描直到遇到 ':' 并将其分配给 a。:
def char_check(x,y): if (str(x) in y or x.find(y) > -1) or (str(y) in x or y.find(x) > -1):
我有一种情况,我想将文本文件中的现有行包含到一个新 block 中。 line 1 line 2 line in block line 3 line 4 应该变成 line 1 line 2 line
我有一个新项目,我正在尝试设置 Django 调试工具栏。首先,我尝试了快速设置,它只涉及将 'debug_toolbar' 添加到我的已安装应用程序列表中。有了这个,当我转到我的根 URL 时,调试
在 Matlab 中,如果我有一个函数 f,例如签名是 f(a,b,c),我可以创建一个只有一个变量 b 的函数,它将使用固定的 a=a1 和 c=c1 调用 f: g = @(b) f(a1, b,
我不明白为什么 ForEach 中的元素之间有多余的垂直间距在 VStack 里面在 ScrollView 里面使用 GeometryReader 时渲染自定义水平分隔线。 Scrol
我想知道,是否有关于何时使用 session 和 cookie 的指南或最佳实践? 什么应该和什么不应该存储在其中?谢谢! 最佳答案 这些文档很好地了解了 session cookie 的安全问题以及
我在 scipy/numpy 中有一个 Nx3 矩阵,我想用它制作一个 3 维条形图,其中 X 轴和 Y 轴由矩阵的第一列和第二列的值、高度确定每个条形的 是矩阵中的第三列,条形的数量由 N 确定。
假设我用两种不同的方式初始化信号量 sem_init(&randomsem,0,1) sem_init(&randomsem,0,0) 现在, sem_wait(&randomsem) 在这两种情况下
我怀疑该值如何存储在“WORD”中,因为 PStr 包含实际输出。? 既然Pstr中存储的是小写到大写的字母,那么在printf中如何将其给出为“WORD”。有人可以吗?解释一下? #include
我有一个 3x3 数组: var my_array = [[0,1,2], [3,4,5], [6,7,8]]; 并想获得它的第一个 2
我意识到您可以使用如下方式轻松检查焦点: var hasFocus = true; $(window).blur(function(){ hasFocus = false; }); $(win
我是一名优秀的程序员,十分优秀!