相关疑难解决方法(0)

CSS表格布局:为什么表格行不接受保证金?

.container {
  width: 850px;
  padding: 0;
  display: table;
  margin-left: auto;
  margin-right: auto;
}
.row {
  display: table-row;
  margin-bottom: 30px;
  /* HERE */
}
.home_1 {
  width: 64px;
  height: 64px;
  padding-right: 20px;
  margin-right: 10px;
  display: table-cell;
}
.home_2 {
  width: 350px;
  height: 64px;
  padding: 0px;
  vertical-align: middle;
  font-size: 150%;
  display: table-cell;
}
.home_3 {
  width: 64px;
  height: 64px;
  padding-right: 20px;
  margin-right: 10px;
  display: table-cell;
}
.home_4 {
  width: 350px;
  height: 64px;
  padding: 0px;
  vertical-align: middle;
  font-size: 150%;
  display: table-cell;
}
Run Code Online (Sandbox Code Playgroud)
<div …
Run Code Online (Sandbox Code Playgroud)

html css

93
推荐指数
5
解决办法
10万
查看次数

div之间的空格 - 显示表格单元格

我这里有两个div:

<div style="display:table-cell" id="div1">
    content
</div>

<div style="display:table-cell" id="div2">
    content
</div>
Run Code Online (Sandbox Code Playgroud)

有没有办法在这两个div(有display:table-cell)之间留出空间?

html css css-tables

93
推荐指数
2
解决办法
13万
查看次数

样式Bootstrap的btn-group-justified,添加边距和垂直大小

我想btn-group-justified用无线电input字段设置原始Bootstrap的样式(http://getbootstrap.com/javascript/#buttons-examples).

原始样式如下所示:
在此输入图像描述

但是我想把每个按钮都做成方形按钮,并在它们之间给它们一些空白.像这样的东西:
在此输入图像描述

我尝试使用Bootstrap示例中的一些修改过的html标记

[data-toggle="buttons"] .btn>input[type="radio"] {
  display: none;
}

.category-select .btn-container {
  position: relative;
  width: 19%;
  padding-bottom: 19%;
  float: left;
  height: 0;
  margin: 1%;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.btn-container .btn,
.btn-container .btn input {
  max-width: 100%;
}
Run Code Online (Sandbox Code Playgroud)
<div class="btn-group-justified category-select" data-toggle="buttons">
  <div class="btn-container">
    <label class="btn category category-one">
          <input type="radio" name="options" id="option1"> One
        </label>
  </div>
  <div class="btn-container">
    <label class="btn category category-two">
          <input type="radio" name="options" id="option2"> Two
        </label>
  </div>
  <div class="btn-container">
    <label class="btn category …
Run Code Online (Sandbox Code Playgroud)

html css css3 twitter-bootstrap twitter-bootstrap-3

13
推荐指数
1
解决办法
3万
查看次数

无法在firefox中居中

所以我有这两张桌子

    <table  id="pointsTable" >
          <th> One </th>                                           
          <th> Two </th>                               
          <th> Three </th>
          <tr>
           <td  id="one" ></td>               
           <td  id="two"></td>              
           <td  id="three"></td>                            
          </tr>
    </table>                                                                            

   <table id="pointsTableSmall" style="text-align: center;">
          <tr>
             <th> One </th>
          </tr>
          <tr>
          <td  id="one"></td>
          </tr>
          <tr>
          <th>Two </th>
          </tr>
          <tr>
          <td  id="two" ></td>
          </tr>
          <tr>
          <th>Three</th>
          </tr>
          <tr>
          <td  id="three" ></td>
          </tr>
   </table>
Run Code Online (Sandbox Code Playgroud)

第一个在大屏幕中可见,第二个在较小的屏幕中可见.

他们的CSS是

#pointsTable, #pointsTableSmall{
    border: 0;
    border-style: 0;   
    margin: auto !important;
    padding: auto;
    text-align: center !important;    

} 
Run Code Online (Sandbox Code Playgroud)

他们的包裹div有

#pointWrap{
    text-align: center;
} 
Run Code Online (Sandbox Code Playgroud)

在Firefox 45.0.1中,表格左对齐,边距为:auto且无填充.左侧对齐间隙与其容器之间的右侧有间隙div. …

css firefox alignment vertical-alignment

8
推荐指数
1
解决办法
902
查看次数

使用带有显示表格单元格的边距

我尝试在li中添加margin-left/margin-right但是它们之间没有空格.我应该添加什么来在列表之间创建一个空格?

CSS:

.btn-top {
    float: right;
    height: 40px;
    margin-right: 10px;
    margin-top: 10px;
}
.btn-top ul {
     height: 100%;
     padding: 0;
}
.btn-top ul li {
    list-style-type: none;
    display: table-cell;
    width: 100px;
    height: 30px;
    vertical-align: middle;
    text-align: center;
    border-style: solid;
    border-color: #333;
    border-width: 2px;
    border-radius: 10px;
}
Run Code Online (Sandbox Code Playgroud)

HTML:

<div class="btn-top"><ul>
     <li><a href="#"><span class="btn" =>btn1</span></a></li>
     <li style="width:150px"><a href="#"><span class="btn">btn2</span></a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)

html css margin css-tables

6
推荐指数
1
解决办法
1万
查看次数

当设备在iOS 7上进入休眠状态时,clock_get_time/mach_absolute_time停止更新

我的应用程序使用mach_absolute_time来计算自上次触摸事件以来的刻度,并在超过10分钟的空闲时间限制时将用户记录下来.

这一切在iOS 6上运行良好,但我注意到它在iOS 7上运行不正确.具体来说,当iOS 7设备被拔掉(电池电量不足)时,设备似乎停止递增其滴答一旦进入睡眠状态控制台中的这一行(这在大约5分钟不活动后发生):

powerd [47]:睡眠:使用BATT(充电:99%)

因此,当我在10分钟后唤醒设备并使用mach_absolute_time计算滴答时,差异显示仅为5分钟(实际上已经过了10分钟).

奇怪的是,一切正常工作,当设备插入电源时,滴答声继续运行.它从未显示设备在插入时会在控制台日志上休眠(尽管屏幕确实关闭,并且在视觉上与拔出插头时的行为相同).

我也尝试过使用clock_get_time,我在那里遇到了同样的问题.

我可以在iOS 7中做些什么来保持设备进入睡眠状态时的马赫绝对时间?我不想使用,[[NSDate date] timeIntervalSince1970]因为用户可以操纵系统时间并绕过它.

感谢您的任何见解.

time objective-c ios mach ios7

5
推荐指数
1
解决办法
1892
查看次数

如何获得分歧之间的间距

body{background-image: url(images/boy_naruto_blond_drop_stern_look_24237_1366x768.jpg);background-attachment: fixed; }
@font-face{
font-family:pagal;
    src:url("fonts/Pagal Font.ttf");}
    @font-face{
font-family:folktale;
src:url("fonts/Folktale.ttf");
}
#titl{
    font-family:folktale;
    text-align:center;
    color: aliceblue;
    font-stretch: ultra-expanded;
font-size: 40px;
    background: rgba(44,95,188,0.3);
    back


}
h1{color: rgb(255,201,14);margin-bottom: 0px;padding-bottom: 0px;border: 0px;}
sub{margin-top: 0px;padding-top: 0px;border-spacing: 0px;}
.icon{height: 150px;width: 200px;text-align: center;}
#naruto{display: table-cell;padding: 20px;background: rgba(220,199,48,0.5);}
#sasuke{display: table-cell;padding: 20px;background: rgba(81,81,255,0.5);}
#sakura{display: table-cell;padding: 20px;background: rgba(231,126,176,0.5);}
#container{display: table-row;}
#table1{display: table;margin: 50px;text-align: center;margin-left: auto;margin-right: auto;}
Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html>
<head>
    <meta charset="utf-8">
<title>Home</title>
    <link type="text/css" rel="stylesheet" href="main.css">

</head>
<body>
    <div id="titl"><h1>NARUTO</h1><sub>never give up</sub></div>
    <div id="table1"><div id="container">
    <div id="naruto"><table><tr><td><img src="images/the_smile_of_uzumaki_by_katsuuyu-d6g8nw6.png" …
Run Code Online (Sandbox Code Playgroud)

html css

5
推荐指数
1
解决办法
61
查看次数

float:右侧CSS属性更改div内按钮的垂直中心位置

<button>当使用CSS 属性未右对齐时,以下代码中的元素是垂直居中的float:right.

HTML


<div class="opponents_list"><b class="opponent_list_bold_name">bob</b>
    <button class="opponent_list_button" type="button">Invite</button>
</div>
<div class="opponents_list"><b class="opponent_list_bold_name">harri</b>
    <button class="opponent_list_button" type="button">Invite</button>
</div>
<div class="opponents_list"><b class="opponent_list_bold_name">harri2</b>
    <button class="opponent_list_button" type="button">Invite</button>
</div>
<div class="opponents_list"><b class="opponent_list_bold_name">kaleeem</b>
    <button class="opponent_list_button" type="button">Invite</button>
</div>
<div class="opponents_list"><b class="opponent_list_bold_name">nehaaa</b>
    <button class="opponent_list_button" type="button">Invite</button>
</div>
<div class="opponents_list"><b class="opponent_list_bold_name">nitiisha</b>
    <button class="opponent_list_button" type="button">Invite</button>
</div>
<div class="opponents_list"><b class="opponent_list_bold_name">rangi</b>
    <button class="opponent_list_button" type="button">Invite</button>
</div>
<div class="opponents_list"><b class="opponent_list_bold_name">tom</b>
    <button class="opponent_list_button" type="button">Invite</button>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS


.opponents_list {
    width: 100vw;
    height: 3em;
    margin: 0.1em auto;
    background: #333;
}
.opponent_list_bold_name {
    line-height: …
Run Code Online (Sandbox Code Playgroud)

css

3
推荐指数
1
解决办法
853
查看次数

display:table-cell margin

我有2个div display: table-cell.我需要他们之间的空间.

margin-left: 5px 对于第二个div不起作用.

我已经看到为什么一个div有"display:table-cell;" 不受保证金影响?回答,但我的问题不是关于如何在一个单元格周围设置边框,而是一个左边缘(而不是填充!)用于具体单元格(右边的)

在此输入图像描述

将绿色div设置为

display: table;
border-collapse: separate;
border-spacing: 10px;
Run Code Online (Sandbox Code Playgroud)

不仅细胞之间,而且在细胞周围都有空间,这就是NOK ...

如何进行?

JSFiddle:http://jsfiddle.net/9cw7rhpu/

html css

1
推荐指数
1
解决办法
9746
查看次数