Questions tagged «css»

CSS(层叠样式表)是一种表示样式表语言,用于描述HTML(超文本标记语言),XML(可扩展标记语言)文档和SVG元素的外观和格式,包括(但不限于)颜色,布局,字体,和动画。它还描述了如何在屏幕,纸张,语音或其他媒体上呈现元素。

10
Twitter Bootstrap警报可以淡入和淡出吗?
当我第一次在Bootstrap中看到警报时,我以为它们的行为将像模式窗口一样,下拉或淡入,然后在关闭时淡出。但是似乎它们总是可见的。我想我可以让他们坐在我的应用程序上方的一层中并设法显示它们,但我想知道该功能是否内置? 谢谢! 编辑,到目前为止我所拥有的: <div id="saveAlert" class="alert-message success fade in" data-alert="alert" style="top:0"> <a class="close" href="#">×</a> <p><strong>Well done!</strong> You successfully read this alert message.</p> </div>

2
Sass无效的CSS错误:“预期的表达式”
我一直在关注 Sass教程。由于某些原因,尽管Sass文件无法正确生成css。终端说css是无效的,但我很确定不是。我也尝试过更改它,以防万一出现问题... 我做错了什么? Sass版本:Sass 3.1.10 错误信息: error sass/test.sass (Line 3: Invalid CSS after "80%": expected expression (e.g. 1px, bold), was ";") .sass文件内容: /* style.scss */ #navbar { width: 80%; height: 23px; }
78 css  sass 

4
如何实现最大字体大小?
我想使用指定字体大小vw,如 font-size: 3vw; 但是,我也想将字体大小限制为36px。我如何才能获得与等效的max-font-size,这是使用媒体查询的唯一选择?

5
CSS关键帧动画CPU使用率很高,应该采用这种方式吗?
我在几个元素上使用以下关键帧动画: @keyframes redPulse { from { background-color: #bc330d; box-shadow: 0 0 9px #333; } 50% { background-color: #e33100; box-shadow: 0 0 18px #e33100; } to { background-color: #bc330d; box-shadow: 0 0 9px #333; } } @-webkit-keyframes redPulse { from { background-color: #bc330d; box-shadow: 0 0 9px #333; } 50% { …
78 css 

15
单选按钮和标签显示在同一行
为什么我的标签和单选按钮不会停留在同一行,该怎么办? 这是我的表格: <form name="submit" id="submit" action="#" method="post"> <?php echo form_hidden('what', 'item-'.$identifier);?> <label for="one">First Item</label> <input type="radio" id="one" name="first_item" value="1" /> <label for="two">Second Item</label> <input type="radio" id="two" name="first_item" value="2" /> <input class="submit_form" name="submit" type="submit" value="Choose" tabindex="4" /> </form>
78 html  css 

10
字体上的超赞错误404
我不知道发生了什么,但是在浏览器控制台中我可以看到3个与font-awesome相关的错误 GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.woff2?v=4.3.0 GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.woff?v=4.3.0 GET http://www.desktop.just4bettors.mobi/fonts/fontawesome-webfont.ttf?v=4.3.0 我知道这很荒谬,我无法自己弄清楚,但一切似乎都很好,在我的index.html中,我有类似的内容 <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.css" /> 这就是我与字体超赞相关的全部内容,我已经检查了路径,对此我没有错。 你们所有人都在发生这种情况吗? 更新 这是NGINX的部分,我在标题中加载了一些内容 add_header Content-Security-Policy "style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://fonts.gstatic.com https://themes.googleusercontent.com https://assets.zendesk.com; font-src 'self' https://themes.googleusercontent.com https://fonts.gstatic.com;";

11
数据协议URL大小限制
“数据:” URL方案值是否有大小限制?我对流行的Web浏览器中的限制感兴趣。换句话说,多久可以data:image/jpg;base64,base64_encoded_data成为<img src="data:image/jpg;base64,base64_encoded_data" />或background-image: url(data:image/jpg;base64,base64_encoded_data)?
78 html  css 


9
下拉框中溢出文本的省略号
我正在固定一个下拉框的宽度(是的,我知道这样做存在跨浏览器问题)。 有没有一种非js的方法来切断溢出的文本并附加省略号?text-overflow:省略号不适用于<select>元素(至少在Chrome中)。 select, div { width:100px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; } <!--works for a div--> <div> A long option that gets cut off </div> <!--but not for a select--> <select> <option>One - A long option that gets cut off</option> <option>Two - A long option that gets cut off</option> </select> 运行代码段隐藏结果展开摘要 此处的示例:http …
78 html  css 

2
同时使用多个CSS过滤器?
我正在尝试使用CSS过滤器。 我想同时使用模糊和灰度,但是我似乎无法在同一张图片上同时使用两者? 在这里看到小提琴... http://jsfiddle.net/joshmoto/fw0m9fzu/1/ .blur { filter: blur(5px); -webkit-filter: blur(5px); -moz-filter: blur(5px); -o-filter: blur(5px); -ms-filter: blur(5px); } .grayscale { filter: grayscale(1); -webkit-filter: grayscale(1); -moz-filter: grayscale(1); -o-filter: grayscale(1); -ms-filter: grayscale(1); } .blur-grayscale { filter: blur(5px) grayscale(1); -webkit-filter: blur(5px) grayscale(1); -moz-filter: blur(5px) grayscale(1); -o-filter: blur(5px) grayscale(1); -ms-filter: blur(5px) grayscale(1); }

6
输入上方带有标签的样式表
我想产生以下表单样式: 姓名电子邮件 [.................] [.................] 学科 [.................] 信息 [......................................................] [......................................................] [......................................................] [......................................................] 我拥有的HTML代码是: <form name="message" method="post"> <section> <label for="name">Name</label> <input id="name" type="text" value="" name="name"> <label for="email">Email</label> <input id="email" type="text" value="" name="email"> </section> <section> <label for="subject">Subject</label> <input id="subject" type="text" value="" name="subject"> <label for="message">Message</label> <input id="message" type="text" value="" name="message"> </section> </form> 目前正在产生: 名称 …
78 html  css 

4
如何在引导程序的表单控件的弹出窗口中更改必填字段的默认消息?
<form class="form-asd" role="form"> <h2 class="form-signin-heading">login</h2><hr /> <label class="control-label" for="username">Username</label> <input class="form-control" type="email" required="" placeholder="username"data-error="enter valid username"></input> <label class="control-label" for="username">password</label> <input class="form-control" type="password" required=" " placeholder="Password"></input> <label class="checkbox"></label> <button class="btn btn-lg btn-primary " type="submit">submit</button> </form> 我们该如何更改require字段“请填写此字段”以“请输入用户名”的默认弹出消息

9
是否可以在CSS中定义常量?
我在CSS样式表中使用了几种颜色。例如 #testdiv{ background: #123456; } 是否可以通过名称定义该颜色,以便我可以像这样在css表中引用它 #testdiv{ background: COLORNAME; }
77 css 

3
如何使用Gulp复制多个文件并保持文件夹结构
我正在尝试使用Gulp将文件从一个文件夹复制到另一个文件夹: gulp.task('move-css',function(){ return gulp.src([ './source/css/one.css', './source/other/css/two.css' ]).pipe(gulp.dest('./public/assets/css/')); }); 上面的代码将one.css&复制two.css到public/assets/css文件夹中。 如果我使用gulp.src('./source/css/*.css')它,会将所有CSS文件复制到public/assets/css不是我想要的文件夹中。 如何选择多个文件并保持文件夹结构?
77 javascript  css  gulp 

9
如何通过JavaScript重新触发WebKit CSS动画?
因此,我有以下-webkit-animation规则: @-webkit-keyframes shake { 0% { left: 0; } 25% { left: 12px; } 50% { left: 0; } 75% { left: -12px; } 100% { left:0; } } 还有一些CSS定义了我的一些动画规则box: #box{ -webkit-animation-duration: .02s; -webkit-animation-iteration-count: 10; -webkit-animation-timing-function: linear; } 我可以shake在#box这样的: document.getElementById("box").style.webkitAnimationName = "shake"; 但是我以后不能再动摇了。 这只会摇晃盒子一次: someElem.onclick = function(){ document.getElementById("box").style.webkitAnimationName = "shake"; …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.