小编dip*_*pas的帖子

CSS子元素选择器 - HTML电子邮件

我试图找到一种方法来改变一个类的CSS,只有它在一个4 td的表中.代码可能会更好地解释我的问题是什么.

HTML

<table class="myclass">
<tr>
  <td>1 <span class="myclass2">xxx</span></td>
  <td>2 <span class="myclass2">xxx</span></td>
  <td>3 <span class="myclass2">xxx</span></td>
</tr>
</table>

<table class="myclass">
<tr>
  <td>1 <span class="myclass2">xxx</span></td>
  <td>2 <span class="myclass2">xxx</span></td>
  <td>3 <span class="myclass2">xxx</span></td>
  <td>4 <span class="myclass2">xxx</span></td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)

CSS

.myclass td:first-child:nth-last-child(3),td:first-child:nth-last-child(3) ~ td {
        background-color:white !important;
    }
.myclass td:first-child:nth-last-child(4),td:first-child:nth-last-child(4) ~ td {
        background-color:red !important;
    }
.myclass2 {
  color:blue;
}
Run Code Online (Sandbox Code Playgroud)

一个JSFiddle准备就绪:JSFIDDLE在这里

我想要做的是改变"myclass2"的样式仅针对表中包含的4个TD的元素,而不是具有3个TD的表.这有可能吗?

html css html-email

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

如何更改bootstrap popover的宽度

我有一个尺寸为的列

width:30pxheight:25px

如果弹出窗口被触发,该列只有一个按钮,它的宽度缩放到列的宽度...有人知道如何增加弹出窗口的宽度吗?

width:100pxheight:50

我使用了以下css代码

.popover{
    widht:100px;
    height:50px;
    overflow:visible;
}
Run Code Online (Sandbox Code Playgroud)

html css twitter-bootstrap bootstrap-popover

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

基于表边界值的CSS选择器

我想table通过CSS选择器访问页面.

该表的结构如下:

<table border="1" width="560" cellspacing="0">
   <tr>
     <td height="28" colspan="3" bgcolor="#FFFFF...>
 </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

基本上我需要在一行中使用jquery或css选择器来访问tablewithborder=1

没有与table第n次访问的父子映射相关联的类或id 也是不可能的

基本上是选择table在那里table border=1(border = 1不是里面style=""),它仅仅是HTML标记

<table border=1"> ....</table>
Run Code Online (Sandbox Code Playgroud)

css jquery css-selectors css3 jquery-selectors

3
推荐指数
2
解决办法
280
查看次数

仅使用CSS在悬停时隐藏同级div

我对一种使CSS(no javascript)展示div您之外的或元素的方式感兴趣:hover,例如:

#divid {
  display: none;
}
a:hover #divid {
  display: block;
}
Run Code Online (Sandbox Code Playgroud)
<a href="#">Hover me!</a>
<div id="divid">Hello there, fellow friend!</div>
Run Code Online (Sandbox Code Playgroud)

我很好奇,因为当您将鼠标悬停在某个菜单元素上时我想做点事情,您会在浏览器的左边缘绘制搜索栏(它将是position: fixed;)。


编辑:

我认为上面的代码并不是我想要的。

这是实际的代码,因为答案始终无法正常工作。

#fixed2 a:hover + .nav {
  background: black;
}
#options:hover + #search_text {
  position: fixed;
  top: 0;
  left: 0;
}
Run Code Online (Sandbox Code Playgroud)
<ul class="nav">
  <li id="left" class="big">
    <a href="#">
      <img width="35px" src="square.png" />
    </a>
  </li>
  <li id="left" class="arrow">
    <a href="#">
      <img src="arrow.png" />
    </a>
  </li>
  <li id="left">
    <a href="#">
      <img width="17px" …
Run Code Online (Sandbox Code Playgroud)

html css hover css-selectors

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

Google字体未在我的电子邮件中显示

我无法在我的电子邮件中显示Google字体.它通过我的浏览器在本地显示,但是当我向Gmail,MSO等发送测试时,它无法正常工作.我能够让MSO后备成为Arial,但我不明白我是如何在Gmail上显示它的.

以下是我所拥有的</head>以及紧随其后的内容<body>:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta property="og:title" content="*|MC:SUBJECT|*">
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="format-detection" content="telephone=no">



  <link href='https://fonts.googleapis.com/css?family=Poppins' rel='stylesheet' type='text/css'>


  <style type="text/css">
    /* /\/\/\/\/\/\/\/\/ MAIL CLIENT & BROWSER-SPECIFIC STYLES /\/\/\/\/\/\/\/\/ */
    #outlook a {
      padding: 0;
    }
    .ReadMsgBody {
      width: 100%;
    }
    .ExternalClass {
      width: 100%;
    }
    .ExternalClass,
    .ExternalClass p,
    .ExternalClass span,
    .ExternalClass font,
    .ExternalClass td,
    .ExternalClass div { …
Run Code Online (Sandbox Code Playgroud)

html css html-email css3 google-webfonts

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

如何使用css过渡将加号变为减号?

我想创建一个切换button,将其形状从加号变为减号.

仅使用CSS, 使用伪元素.

想要的效果是让"+"符号中的垂直线收缩到水平线.

我知道这是可能的,但我不确定哪条路是最佳路线.我正在考虑做一些事情,height但我担心line-height浏览器会改变它在元素中的位置.

$('button').on("click", function(){
  $(this).toggleClass('active');
});
Run Code Online (Sandbox Code Playgroud)
button {
color: #ecf0f1;
background:  #e74c3c;
  width: 50px;
  height: 50px;
  border: 0;
  font-size: 1.5em;
  }
button span {
  transition: all .75s ease-in-out;
  }
button.active span {
  /* Code to morph + to - */
  }
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<button><span>+</span></button>
Run Code Online (Sandbox Code Playgroud)

html css css3 css-transitions

3
推荐指数
2
解决办法
7242
查看次数

CSS 手动设置内联块元素的基线并使其采用预期的高度

我正在设计一个海天组件。我希望它的基线处于海平面。

这是正确渲染的尝试。

.out {
   display:inline-block;
   background-color:yellow;
   padding-bottom:30px; 
}

.outer {
   display:inline-block;
   background-color:cyan;
   width:100px;
   height:100px;
   position:relative;
   bottom:-30px ;
}

.inner {
  position:absolute;
  height:30px;
  background-color:blue;
  bottom:0px;
  width:100%;
}
Run Code Online (Sandbox Code Playgroud)
<div class="out">hello<div class="outer"><div class="inner">
</div></div>foobar</div>
Run Code Online (Sandbox Code Playgroud)

这里的技巧是设置一个负底部并使用填充使 .out 底部位于预期位置。这是没有填充的情况。

.out {
   display:inline-block;
   background-color:yellow;
}

.outer {
   display:inline-block;
   background-color:cyan;
   width:100px;
   height:100px;
   position:relative;
   bottom:-30px ;
}

.inner {
  position:absolute;
  height:30px;
  background-color:blue;
  bottom:0px;
  width:100%;
}
Run Code Online (Sandbox Code Playgroud)
<div class="out">hello<div class="outer"><div class="inner">
</div></div>foobar</div>
Run Code Online (Sandbox Code Playgroud)

但是,使用多个此类组件需要将填充设置为最后一行上所有组件底部的最大值。这是不可行的。

有没有办法不用 padding-bottom ?

html css

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

使用calc()的CSS操作

我一直在使用calc()CSS属性,我有一个疑问:

.main {
  display: block;
  margin-left: 4rem;
  width: (100% - nav);
  background: red;
}
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 4rem;
  height: 100vh;
  background: #292929;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}
Run Code Online (Sandbox Code Playgroud)

就像你在代码中看到的那样我试图减去100%- WIDTH它是rem响应模式的导航,但显然它不起作用,有什么方法可以做到这一点?

css css3 css-calc

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

什么css类像my-2,my-lg-0,mr-sm-2在bootstrap 4中做什么?

我已经查看了其他问题和bootstrap文档,似乎无法找出这些类对元素的作用.任何帮助表示赞赏!我只是想让我的搜索栏在大视口上的大小为1/4,在中型视口上大小为1/3,在小视口上大小为100%!

html css navbar twitter-bootstrap bootstrap-4

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

如何在 Swiper 幻灯片中预加载视频

我正在使用 swiper(用于角度)将视频集成到我的幻灯片中(每张幻灯片一个视频)。当滑动幻灯片时,它非常滞后。然而,当视频已经加载时,例如当滑回到之前的视频时,滑动是平滑的。有人知道如何防止滞后行为吗?是否可以预加载视频?

angular swiper.js

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