我想创build一个固定的侧边栏,存在于我的中心Bootstrap网格之外。 尝试这样做时面临的挑战是确定什么额外的样式应用/覆盖到我的.container以便它不重叠我的边栏时,屏幕的大小调整。 对于初学者,我只使用CSS框架的网格部分,因此.container , .row和.col-md-12是从bootstrap.css文件本身拉取的代码,不是自定义的。 另外请记住,我正在使用Bootstrap 3 ,所以请不要在Bootstrap 2中提供stream畅的网格解决scheme,这在以前的线程中经常被问到。 HTML <div id="left-nav"></div> <div class="container"> <div class="row"> <div class="col-md-12"> <p>Lorem ipsum dolor sit amet, nunc dictum at.</p> </div> </div> </div> CSS html, body { height: 100%; width: 100%; } #left-nav { background: #2b2b2b; position: absolute; top: 0px; left: 0px; height: 100%; width: 250px; }
在Google Chrome的开发者工具中,我在<html lang="en">标签下看到#shadow-root 。 它做什么,它用于什么? 我没有看到它在Firefox或IE中; 只有在Chrome中,这是一个特殊的function? 如果我打开它,它会显示<head>和<body>以及旁边名为reveal的链接,通过点击,它指向<head>和<body> ,没有别的。
我有一个表格数据,我需要导出到CSV没有使用任何外部插件或API。 我使用了传递MIMEtypes的window.open方法,但遇到了如下的问题: 如何确定Microsoft Excel或Open Office是否安装在使用jQuery的系统上 代码应该独立于系统上正在安装什么,即openoffice或ms excel。 我相信CSV是这两种编辑能够期待的格式。 码 <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/JavaScript"> $(document).ready(function(){ $("#btnExport").click(function(e) { var msg = GetMimeTypes(); //OpenOffice window.open('data:application/vnd.oasis.opendocument.spreadsheet,' + $('#dvData').html()); //MS-Excel window.open('data:application/vnd.ms-excel,' + $('#dvData').html()); //CSV window.open('data:application/csv,charset=utf-8,' + $('#dvData').html()); e.preventDefault(); }); }); function GetMimeTypes () { var message = ""; // Internet Explorer supports the mimeTypes collection, but it is […]
我有一个textarea包含在一个div中,因为我有jQuery的提示,并希望使用不透明度而不改变边框。 有一个可见的垂直滚动条,我只想当我在文本字段中input时显示它,并超出容器。 我已经尝试溢出:汽车; 但不起作用。 文本域: <label> <div id="name"> <textarea name="message" type="text" id="message" title="Enter Message Here" rows=9 cols=60 maxlength="2000"></textarea> </div> </label> 样式: #name { border: 1px solid #c810ca; width: 270px; height:159px; overflow: hidden; position: relative; } #message { height: 400px; width: 235px; overflow: hidden; position: absolute; }
我试图将一个子div标签alignment到父div标签的底部或基线。 我想要做的就是在Parent Div的基线上有孩子Div,现在看起来像这样: HTML <div id="parentDiv"> <div class="childDiv"></div> </div> CSS #parentDiv { width:300px; height:300px; background-color:#ccc; background-repeat:repeat } #parentDiv .childDiv { height:100px; width:30px; background-color:#999; } 注意 我将有多个不同高度的childDiv ,我将需要他们全部alignment基线/底部。
一个div标签可以有两个类? 我使用twitter bootstrap,并有两个预定义的类,我想要使用。 一个是我想在导航栏中使用dropdown-toggle的active类。 什么是在HTML中接近这个最好的方式,而不是覆盖CSS。
我被要求创build一个实际的HTML页面/ JavaScript来模拟使用JavaScript代码检测移动设备(iPhone / iPad / Android)。 然后这将使用户到另一个屏幕,要求他们的电子邮件地址。
我可以将2个类应用于单个div或跨度或任何html元素吗? 例如: <a class="c1" class="c2">aa</a> 我试过,在我的情况下,C2没有得到应用。 我怎样才能一次申请两个class?
<div style="display: inline-block; margin: 0 auto;"> <input id="abc" type="button" value="button" /> </div> 我尝试使用上面的代码来设置等于它的内容的宽度,然后居中使用margin:0 auto; 但是在任何浏览器上都不适合我。 任何build议? 顺便说一下,当我设置宽度属性,它工作正常。 <div style="width: 10em; margin: 0 auto;"> <input id="abc" type="button" value="button" /> </div>
我有一个链接的图像。 当用户hover在链接上时,我想显示不同的图像。 目前我正在使用这个代码: <a href="http://twitter.com/me" title="Twitter link"> <div id="twitterbird" class="sidebar-poster"></div></a> div.sidebar-poster { margin-bottom: 10px; background-position: center top; background-repeat: no-repeat; width: 160px; } #twitterbird { background-image: url('twitterbird.png'); } #twitterbird:hover { background-image: url('twitterbird_hover.png'); } 但是我遇到了很多问题:div没有采用CSS规则(当我在Firebug中查看它时,元素并没有显示相关的CSS规则)。 也许这是因为(据我所知)这是无效的HTML:你不能把一个<a>围绕一个<div> 。 但是,如果我切换到<span>那么看起来我会遇到更大的问题,因为您无法可靠地设置跨度的高度和宽度 。 帮帮我! 我怎样才能做得更好?