- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
根据以下答案进行大规模编辑
原始帖子在这里 http://webmasters.stackexchange.com在 miration 之前。
我终于让页面在所有浏览器(所有主要浏览器;Chrome、Opera、Safari、Firefox)上都能正常布局,IE 9 及其遗留版本除外。目前,链接在第二个链接(具有下拉菜单)之后停止显示在“导航”栏中。这些链接对于下拉菜单都是水平安全的,直到它到达第三个链接并且它们都显示在“导航”栏下方并作为垂直列表。我确定问题需要一个单独的 IE 样式表,但问题是主样式表或菜单样式表,目的是什么?
这是布局的图片:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>College Of Martial Arts</title>
<link href="menu.css" rel="stylesheet" type="text/css">
<link href="master.css" rel="stylesheet" type="text/css"><!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="wrap">
<div id="logo" class="logo"><img src="images/comalogo.png" width="100" height="150"></div>
<header>
<p> College Of Martial Arts</p>
</header>
<!-- This is the HTML for the navigation bar at the top of the website -->
<nav>
<ul id="menu"><b>
<li><a href="#">News</a></li>
<li>·</li>
<li><a href="#">About Us</a>
<ul>
<li><a href="#">The Instructors</a></li>
<li><a href="#">Our Arts</a></li>
</ul>
</li>
<li>·</li>
<li><a href="#">Location</a></li>
<li>·</li>
<li><a href="#">Gallery</a></li>
<li>·</li>
<li><a href="#">MMA.tv</a></li>
<li>·</li>
<li><a href="#">Schedule</a></li>
<li>·</li>
<li><a href="#">Fight Gear</a></li></b>
</ul>
</nav>
<!-- end nav -->
<div class="midwrap">
<div class="sidebar1">
<aside>
<p>This is an area for module/blocks for various uses such as; upcoming events, shout box, mini calendar and many more possibilities.</p>
</aside>
<!-- end .sidebar1 --></div>
<article class="content">
<h1>Main Content Area</h1>
<section>
<h2>A place to post content</h2>
<p>"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"
<a href="http://www.lipsum.com/">http://www.lipsum.com/</a>.</p>
</section>
<div class="clearfooter"></div>
<!-- end .content --></article></div>
<footer>
<p>This footer contains the declaration position:relative; to give Internet Explorer 6 hasLayout for the footer and cause it to clear correctly. If you're not required to support IE6, you may remove it.</p>
<address>
Address Content
</address>
</footer>
<!-- end .wrap --></div>
</body>
</html>
CSS3-菜单样式表
@charset "utf-8";
/* CSS Document */
/* Main */
#menu
{
width: 100%;
margin: 0;
padding: 10px 0 0 0;
list-style: none;
background: url(images/menubg.png) repeat-x;
background: -moz-linear-gradient(#000, #333);
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #444),color-stop(1, #000));
background: -webkit-linear-gradient(#000, #333);
background: -o-linear-gradient(#000, #333);
background: -ms-linear-gradient(#000, #333);
background: linear-gradient(#000, #333);
-moz-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0 2px 1px #9c9c9c;
-webkit-box-shadow: 0 2px 1px #9c9c9c;
box-shadow: 0 8px 8px #9c9c9c;
/* outline:#000 solid thin; */
}
#menu li
{
left:150px;
float: left;
padding: 0 0 10px 0;
position:relative;
color: #FC0;
font-size:15px;
font-family:'freshman' cursive;
line-height:15px;
display: inline-block;
}
#menu a
{
float: left;
height: 15px;
line-height:15px;
padding: 0 10px;
color: #FC0;
font-size:15px;
text-decoration: none;
text-shadow: 1 1px 0 #000;
text-align:center;
}
#menu li:hover > a
{
color: #fafafa;
}
*html #menu li a:hover /* IE6 */
{
color: #fafafa;
}
#menu li:hover > ul
{
display: block;
}
/* Sub-menu */
#menu ul
{
list-style: none;
margin: 0;
padding: 0;
display: none;
position: absolute;
top: 25px;
left: 0;
z-index: 99999;
background: url(images/menubg.png) repeat-x;
background: -moz-linear-gradient(#000, #333);
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #111),color-stop(1, #444));
background: -webkit-linear-gradient(#000, #333);
background: -o-linear-gradient(#000, #333);
background: -ms-linear-gradient(#000, #333);
background: linear-gradient(#000, #333);
-moz-border-radius: 5px;
border-radius: 5px;
/* outline:#000 solid thin; */
}
#menu ul li
{
left:0;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
#menu ul a
{
padding: 10px;
height: auto;
line-height: 1;
display: block;
white-space: nowrap;
float: none;
text-transform: none;
}
*html #menu ul a /* IE6 */
{
height: 10px;
width: 200px;
}
*:first-child+html #menu ul a /* IE7 */
{
height: 10px;
width: 200px;
}
/* Clear floated elements */
#menu:after
{
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
* html #menu { zoom: 1; } /* IE6 */
*:first-child+html #menu { zoom: 1; } /* IE7 */
CSS3 - 主样式表 -
@charset "utf-8";
*{
margin: 0;
padding: 0;
}
html{
height:100%;
}
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background: #000;
margin: 0;
padding: 0;
color: #000;
}
/* ~~ Element/tag selectors ~~ */
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
padding: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6, p {
margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing block. The remaining bottom margin will hold it away from any elements that follow. */
padding-right: 15px;
padding-left: 15px; /* adding the padding to the sides of the elements within the blocks, instead of the block elements themselves, gets rid of any box model math. A nested block with side padding can also be used as an alternate method. */
}
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
border: none;
}
/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
a:link {
color: #FC0;
text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
}
a:visited {
color: #FC0;
text-decoration: underline;
}
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
text-decoration: none;
}
/* ~~ This fixed width container surrounds all other blocks ~~ */
.wrap {
position: relative;
width: 1250px;
min-height: 100%;
margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout */
color: #fff;
}
div.logo{
position: absolute;
top: 25px;
left: 20px;
}
header {
background-color: #999;
color: #FC0;
margin-left: 5px;
height: 80px;
width: 1240px;
line-height: 70px;
font-family: 'freshman' cursive;
font-size: 50px;
text-shadow: 8px 8px #9c9c9c;
text-outline: 1px 1px #000;
text-align: center;
}
/* ~~ These are the columns for the layout. ~~
1) Padding is only placed on the top and/or bottom of the block elements. The elements within these blocks have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the block itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the block element and place a second block element within it with no width and the padding necessary for your design.
2) No margin has been given to the columns since they are all floated. If you must add margin, avoid placing it on the side you're floating toward (for example: a right margin on a block set to float right). Many times, padding can be used instead. For blocks where this rule must be broken, you should add a "display:inline" declaration to the block element's rule to tame a bug where some versions of Internet Explorer double the margin.
3) Since classes can be used multiple times in a document (and an element can also have multiple classes applied), the columns have been assigned class names instead of IDs. For example, two sidebar blocks could be stacked if necessary. These can very easily be changed to IDs if that's your preference, as long as you'll only be using them once per document.
4) If you prefer your nav on the left instead of the right, simply float these columns the opposite direction (all left instead of all right) and they'll render in reverse order. There's no need to move the blocks around in the HTML source.
*/
.midwrap{
float: left;
background-color: #999;
margin-left: 5px;
width: 1240px;
color: #FFF;
}
.sidebar1 {
float: right;
width: 250px;
background: #999;
padding: 10px 0px 0px 10px;
}
.content {
padding: 10px 0;
width: 850px;
float: right;
background:#999;
}
/* ~~ This grouped selector gives the lists in the .content area space ~~ */
.content ul, .content ol {
padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
}
.clearfooter {
height: 330px;
}
/* ~~ The footer ~~ */
footer {
margin-left:5px;
height: 330px;
width:1240px;
padding: 10px 0;
background: #69F;
bottom: 0;
position: relitive;/* this gives IE6 hasLayout to properly clear */
clear: both; /* this clear property forces the .container to understand where the columns end and contain them */
}
/*HTML 5 support - Sets new HTML 5 tags to display:block so browsers know how to render the tags properly. */
header, section, footer, aside, nav, article, figure {
display: block;
}
最佳答案
</li>
和 </ul>
在 <li>Our Arts</li>
之后被交换这使 CSS 消失了。为了更好地衡量,在 CSS 中使用 display: inline-block;
对于 #menu ul {}
和 #menu li {}
.
关于HTML5 CSS3 布局不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10864369/
我有一个名为 main.css 的 css 文件和另一个名为 style.css 的文件。我怎样才能在 main.css 中做到这一点? .someClass { //apply rules to
在更新我的 css 之前,我在 Login.css 中有以下内容: body { background-image: url('./pictures/fond.png'); bac
我的 share point 2013 核心 css 和我的 css 之间存在 css 冲突。所以我想把我所有的类都放在 div #s4-workspace 下但是我搜索了一种方法来将所有类分组到这个
我知道您可以覆盖 jsp 页面从 jsp 包含 CSS 文件(即全局 CSS 文件)继承的 CSS 属性。 但是,如果元素中的某个属性弄乱了特定页面,而我不想只使用内联 CSS 在该页面中使用它怎么办
我刚刚发现了 initial-scale 元属性。 以前,我一直在使用 default.css 来定义我所有的样式和大小(用于字体和元素),以便它们在桌面计算机的屏幕上显示得很好。然后,如果您使用的是
我正在尝试使用 LESS CSS 来编写我的 CSS。我已经按顺序导入了 style.less 和 less.js 文件。 现在我想提取 LESS 生成的 CSS。有什么办法可以做到吗?我不想使用脚本
我想知道是否有任何一种软件可以读取大量内联样式中的 HTML 文档并将所有这些样式转换为外部 css 文件。如果只有一页,我可以手动完成。但是有100页。有人有想法吗? 最佳答案 就像有人说的那样,“
当我想从 Styled Components 迁移到 CSS Modules 时,出现了以下问题。 假设我有以下样式组件,它接受动态参数 offset和一个动态 CSS 字符串 theme : con
有没有办法将 CSS 类定义为与另一个类相等?例如,如果我有一个类: .myClass{ background-color: blue; } 有没有一种方法可以将第二个类定义为与 myClas
我正在尝试制作一组按钮,这些按钮贴在页面底部并且由固定的空间隔开。我正在使用 angularJS 的 ng-repeat 指令通过 ajax 请求获取数据,然后我用它来显示按钮。 我的问题在于让按
浏览器是否在加载 CSS 文件时解析 CSS?还是在整个 CSS 文件被浏览器下载后才进行解析?不同浏览器的做法有区别吗?我在哪里可以找到这种底层信息? 这个问题不是 Load and executi
这个问题在这里已经有了答案: Can a CSS class inherit one or more other classes? (29 个答案) 关闭 3 年前。 标题有点乱,我给大家看一下。假
我遇到了最奇怪的问题...... 在最简单的形式中,我有一个包含以下内容的 index.html 文件: (在尝试确定根本原因的过程中,我已经大大减少了它) 当我查看页面的源代码时,我得到以下信息:
我正在使用 Mindscape Workbench 来最小化我的 scss 文件。我的页面设置为使用 *.min.css 文件。在随机时间,min 文件不会与系统的其余部分一起发布。 我有很多 css
请告诉我 CSS 框架和 CSS 网格之间的区别。 最佳答案 CSS 框架也可以是 CSS 网格框架。 CSS 网格框架用于构建 CSS 布局。有一些框架除了构建布局还有其他用途,例如 Hartija
我有无法从页面中删除或更改的 original.css 文件。原始.css table { border-collapse: collapse; border-spacing: 0;
我以前使用 bootstrap css import 很好。 但是我正在尝试使用 CSS 模块,所以我添加了几行。 { test: /\.css$/, use:
有没有办法在 css 选择器中创建一个 css 组。 例如: .SectionHeader { include: .foo; include: .bar; include: .
今天我学习了 CSS 中的两个概念,一个是 CSS 定位(静态、相对、绝对、固定),另一个是 CSS Margin,它定义了元素之间的空间。 假设我想移动一个元素,这是最好的方法吗?因为这两个概念似乎
var paths = { css: './public/apps/user/**/*.css' } var dest = { css: './public/apps/user/css/' } /
我是一名优秀的程序员,十分优秀!