Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何在第二行中获得与交叉浏览器兼容的省略号[React]_Html_Css_Reactjs_Jsx_Ellipsis - Fatal编程技术网

Html 如何在第二行中获得与交叉浏览器兼容的省略号[React]

Html 如何在第二行中获得与交叉浏览器兼容的省略号[React],html,css,reactjs,jsx,ellipsis,Html,Css,Reactjs,Jsx,Ellipsis,我需要这样。该剪辑仅在铬合金中工作。我需要这个做一个项目。只使用css会有帮助。您可以使用插件(jQuery)来实现此效果。具有浏览器兼容性和响应能力。您可以通过这种方式使用一种解决方案 像这样的 /* styles for '...' */ .block-with-text { /* hide text if it more than N lines */ overflow: hidden; /* for set '...' in absolute position */


我需要这样。该剪辑仅在铬合金中工作。我需要这个做一个项目。只使用css会有帮助。

您可以使用插件(jQuery)来实现此效果。具有浏览器兼容性和响应能力。

您可以通过这种方式使用一种解决方案

像这样的

/* styles for '...' */ 
.block-with-text {
  /* hide text if it more than N lines  */
  overflow: hidden;
  /* for set '...' in absolute position */
  position: relative; 
  /* use this value to count block height */
  line-height: 1.2em;
  /* max-height = line-height (1.2) * lines max number (3) */
  max-height: 3.6em; 
  /* fix problem when last visible word doesn't adjoin right side  */
  text-align: justify;  
  /* place for '...' */
  margin-right: -1em;
  padding-right: 1em;
}
/* create the ... */
.block-with-text:before {
  /* points in the end */
  content: '...';
  /* absolute position */
  position: absolute;
  /* set position to right bottom corner of block */
  right: 0;
  bottom: 0;
}
/* hide ... if we have text, which is less than or equal to max lines */
.block-with-text:after {
  /* points in the end */
  content: '';
  /* absolute position */
  position: absolute;
  /* set position to right bottom corner of text */
  right: 0;
  /* set width and height */
  width: 1em;
  height: 1em;
  margin-top: 0.2em;
  /* bg color = bg color under block */
  background: white;
}
参考链接-