Questions tagged «css»

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


12
如何使Twitter Bootstrap子菜单在左侧打开?
我试图在下拉菜单中创建twitter bootstrap子菜单,但遇到一个问题:我在页面的右上角有下拉菜单,并且该菜单还有一个子菜单。但是,子菜单打开时-它不适合窗口且向右移太多,因此用户只能看到第一个字母。如何使该子菜单不在右侧打开,而是在左侧打开?

6
如何使用jQuery取消设置元素的CSS属性?
如果我使用以下命令在特定元素上设置CSS值: $('#element').css('background-color', '#ccc'); 我希望能够取消设置特定于元素的值并使用级联值,具体如下: $('#element').css('background-color', null); 但是该语法似乎不起作用–是否可以使用其他语法? 编辑:该值不是从父元素继承的-原始值来自元素级选择器。抱歉给您带来任何混乱!
93 jquery  css 

13
合并并缩小多个CSS / JS文件
我正在尝试通过合并和压缩CSS和JS文件来优化网站性能。考虑到我所面临的实际情况,我的问题更多是关于如何实现这一(具体)步骤的(尽管在其他开发人员中也应该是典型的)。 我的页面引用了多个CSS和JS文件,如下所示: <!-- It's easier to work on smaller files during development. Hence, the multiple CSS and JS files. --> <link type="text/css" rel="stylesheet" href="/css/main.css" /> <link type="text/css" rel="stylesheet" href="/css/secondary-1.css" /> <link type="text/css" rel="stylesheet" href="/css/secondary-2.css" /> <script type="text/javascript" src="/scripts/js/main.js"></script> <script type="text/javascript" src="/scripts/js/adapter/adapter.js"></script> <script type="text/javascript" src="/scripts/js/adapter/title-adapter.js"></script> 对于生产版本,我想将3个CSS文件合并为一个,并使用例如YUI Compressor将其最小化。但是,然后,我需要更新所有需要这3个文件的页面,以引用新近缩小的CSS。这似乎容易出错(例如,您要在许多文件中删除并添加一些行)。还有其他风险较小的方法吗?JS文件也有同样的问题。

9
如何模拟更高分辨率的屏幕?[关闭]
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案会得到事实,参考或专业知识的支持,但是这个问题可能会引起辩论,争论,民意调查或扩展讨论。如果您认为此问题可以解决并且可以重新提出,请访问帮助中心以获取指导。 7年前关闭。 浏览器有什么方法可以以比屏幕高的分辨率测试我的网站? 例如:我的屏幕为1440 x 900,我想以1920 x 1200、1920 x 1080等测试网站。
93 html  css  resolution 

5
使Div覆盖整个页面(不仅仅是视口)吗?
所以我有一个我认为很普遍的问题,但是我还没有找到一个好的解决方案。我想使div覆盖整个页面...而不仅仅是视口。我不明白为什么这很难做到...我尝试将body,html高度设置为100%等,但这是行不通的。这是我到目前为止的内容: <html> <head> <style type="text/css"> .OverLay { position: absolute; z-index: 3; opacity: 0.5; filter: alpha(opacity = 50); top: 0; bottom: 0; left: 0; right: 0; width: 100%; height: 100%; background-color: Black; color: White;} body { height: 100%; } html { height: 100%; } </style> </head> <body> <div style="height: 100%; width: …
93 html  css 


4
如何以定义的宽度/高度垂直对齐div内容的中心?
这将是垂直居中在限定的宽度/高度的任何内容的正确方法div。 在该示例中,有两个具有不同高度的内容,什么是使用class垂直居中的最佳方法.content?(并且适用于所有浏览器,而没有的解决方案table-cell) 想到了一些解决方案,但想知道其他想法,一个正在使用position:absolute; top:0; bottom: 0;和margin auto。

10
禁用的输入文字颜色
下面的简单HTML在基于Firefox和基于WebKit的浏览器中的显示方式有所不同(我在Safari,Chrome和iPhone中进行了检查)。 在Firefox中,边框和文本都具有相同的颜色(#880000),但在Safari中,文本会变得更浅一些(好像已对其应用了一些透明度)。 我可以以某种方式解决此问题(在Safari中删除此透明度)吗? <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <style type="text/css"> input:disabled{ border:solid 1px #880000; background-color:#ffffff; color:#880000; } </style> </head> <body> <form action=""> <input type="text" value="disabled input box" disabled="disabled"/> </form> </body> </html>
93 iphone  html  css  safari  webkit 

13
使HTML5视频海报的尺寸与视频本身的尺寸相同
有谁知道如何调整HTML5视频海报的大小,使其适合视频本身的确切尺寸? 这是显示问题的jsfiddle:http : //jsfiddle.net/zPacg/7/ 这是代码: HTML: <video controls width="100%" height="100%" poster="http://www.wpclipart.com/blanks/buttons/glossy_buttons/glossy_button_blank_orange_rectangle.png"> <source src="http://demo.inwebson.com/html5-video/iceage4.mp4" type="video/mp4" /> <source src="http://demo.inwebson.com/html5-video/iceage4.ogg" type="video/ogg" /> <source src="http://demo.inwebson.com/html5-video/iceage4.webm" type="video/webm" /> </video>​ CSS: video{ border:1px solid red; }​ 请注意,橙色矩形不会缩放到视频的红色边框。 另外,仅在下面添加CSS也不起作用,因为它会重新调整视频和海报的比例: video[poster]{ height:100%; width:100%; }


13
TD宽度,不工作?
所以我在这里有这段代码: <table> <tr> <td width="200px" valign="top"> <div class="left_menu"> <div class="menu_item"> <a href="#">Home</a> </div> </div> </td> <td width="1000px" valign="top">Content</td> </tr> </table> 与CSS .left_menu { background: none repeat scroll 0 0 #333333; border-radius: 5px 5px 5px 5px; font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; padding: 5px; } .menu_item { background: none repeat scroll …
93 html  css  html-table  width 

4
在<h1>标记后删除换行符?
我在删除&lt;h1&gt;标签后的换行符时遇到问题,因为每次打印时,它都会在标签后直接添加换行符,因此像这样&lt;h1&gt;Hello World!&lt;/h1&gt; &lt;h2&gt;Hello Again World!&lt;/h2&gt;打印出来: Hello World! Hello Again World! 我不确定在CSS中需要更改哪些标签,但是我希望这与填充或边距有关 我也想尽可能保持垂直填充。

12
如何使<label>和<input>出现在HTML表单的同一行上?
我正在为网站创建注册表。我希望每个标签及其对应的输入元素都显示在同一行上。 这是我的代码: #form { background-color: #FFF; height: 600px; width: 600px; margin-right: auto; margin-left: auto; margin-top: 0px; border-top-left-radius: 10px; border-top-right-radius: 10px; padding: 0px; } label { font-family: Georgia, "Times New Roman", Times, serif; font-size: 18px; color: #333; height: 20px; width: 200px; margin-top: 10px; margin-left: 10px; text-align: right; clear: both; } input …
93 html  css  forms 


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.