- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在为一个学校元素设计一个网站。结果进展顺利,但我意识到一个问题。重新缩放浏览器窗口时,布局变得一团糟。我在 google 上搜索了流动布局等,但并没有真正掌握它。我在编码方面真的没有那么多经验,所以我希望更有经验的人能给我一些帮助。
布局 CSS 看起来像这样
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
list-style: none;
text-decoration: none;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
*{
padding: 0.0;
margin: 0;
}
body {
width: 100%;
height: 100%;
/*text-align: justify;
line-height: 16px;*/
font-family: 'Century Gothic', 'Trebuchet MS', Verdana, Sans-Serif;
font-size: 12px;
background-color: #E8E8E8;
}
h1 {
font-size: 32px;
margin: 15px 0 10px 0;
color: #f99929;
font-weight: normal;
}
h2 {
font-size: 24px;
margin: 10px 0 5px 0;
color: #f99929;
font-weight: normal;
}
h3{
font-size: 18px;
margin: 5px 0 2px 0;
color: #f99929;
font-weight: normal;
}
h4{
font-size: 18px;
margin: 5px 0 2px 0;
color: #f99929;
font-weight: normal;
}
strong{
font-weight: bold;
}
em{
font-style:italic
}
a:link {color:#f7931e;} /* unvisited link */
a:visited {color:#f7931e;} /* visited link */
a:hover {color:#f7641e;} /* mouse over link */
a:active {color:#f7931e;}
.clear {
clear: both;
}
/* Left and right menu */
.menuholder {
position: relative;
width: 160px;
height: 1px;
float: right;
}
.facebooklike {
position: fixed;
top: 400px;
margin-top: 20px;
}
.sidemenu {
position: fixed;
top: 166px;
background-color: #FFF;
box-shadow: 0px 3px 5px #888888;
-moz-box-shadow: 0px 3px 5px #888888;
-webkit-box-shadow: 0px 3px 5px #888888;
margin-top: 60px;
}
.sidemenu h1{
font-size: 18px;
margin: 10px 0 10px 10px;
}
.sidemenu ul li a {
display:block;
color: #000;
width: 155px;
font-size: 15px;
padding: 3px 0 10px 5px;
text-align: left;
}
.sidemenu ul li a:hover{
background-image: url('../images/menubutton.png');
box-shadow: 0px 3px 5px #888888;
-moz-box-shadow: 0px 3px 5px #888888;
-webkit-box-shadow: 0px 3px 5px #888888;
}
.sidemenu ul li ul {
display:block;
}
.sidemenu ul li ul li a{
font-size: 14px;
padding-left: 10px;
width: 130px;
border: none;
}
.sidemenu ul li ul li a:hover{
padding-left: 10px;
background-color: #f99929;
}
.sidemenu ul li ul li a:active{
padding-left: 15px;
width: 145px;
background-color: #f99929;
}
/* Main div */
#Main {
position: relative;
width: 960px;
height: 100%;
margin-right: auto;
margin-left: auto;
margin-top: 240px;
}
#ContentContainer {
line-height: 150%;
/*float:left; */
padding: 30px 40px 20px 40px;
margin: 20px auto 0px auto;
width: 525px;
min-height: 480px;
background-color: #FFF;
box-shadow: 0 0 30px #B8B8B8;
-moz-box-shadow: 0 0 30px #B8B8B8;
-webkit-box-shadow: 0 0 30px #B8B8B8;
}
#ContentContainer p {
padding-bottom: 12px;
}
/* Footer */
#Footer {
margin: 0 auto;
border-top: solid #B8B8B8 1px;
width: 400px;
height: 40px;
background-color: #FFF;
padding-left: 20px;
}
/* Header */
#Header {
background-repeat: no-repeat;
background-position: center;
height: 220px;
width: 100%;
position: fixed;
top: 0px;
}
.logotype {
float: left;
position: relative;
left:0px;
z-index: 2;
height: 150px;
width: 200px;
margin: 10px 10px 10px 10px;
background-image: url('../images/loggan.png');
background-repeat: no-repeat;
}
/* Top menu */
#navigation {
font-family: 'Century Gothic', 'Trebuchet MS', Verdana, Sans-Serif;
width: 100%;
height: 20px;
margin: 0px 0 0 65px;
/*background-color: rgba(3,3,3,0.5);*/
}
#navigation ul {
margin: 0 auto;
width: 800px;
}
#navigation ul li {
float: left;
margin: -0px 0px -0px 0px;
box-shadow: 0px 2px 2px #888888;
-moz-box-shadow: 0px 2px 2px #888888;
-webkit-box-shadow: 0px 2px 2px #888888;
background-image: url('../images/aktivbutton.png');
/* border: 0px solid #000; border-radius: 5px; */
}
#navigation ul li a {
display: block;
width: 120px;
padding: 3px 0px;
font-size: 21px;
text-align: center;
color: #000;
/*border: solid 1px #fbad18;*/
}
#navigation ul li a:hover {
background-image: url('../images/topbutton2.png');
/* border: 0px solid #000; border-radius: 5px; */
background-repeat: repeat-x;
background-position: left;
background-color: rgba(249,153,41,0.9);
color: #000;
}
#navigation ul li a:active {
color: #000;
}
#navigation ul li:hover ul {
display: block;
}
#navigation ul li ul {
position: relative;
top: 0px;
left: 0px;
display: none;
float: left;
width: 120px;
}
#navigation ul li ul li {
margin: 0px;
}
#navigation ul li ul li a{
padding:5px 0px 10px 0px;
font-size: 16px;
}
页面布局的 HTML 文件。
<!doctype html>
<html lang="en" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<link rel="shortcut icon" href="favicon.gif" type="image/x-icon">
<% base_tag %>
<meta charset="utf-8">
<meta property="og:title" content="Trappan"/>
<meta property="og:site_name" content="Trappan"/>
<title>Trappan - $Title</title>
<% require javascript(themes/anka/javascript/jquery-1.9.1.js) %>
<% require javascript(themes/anka/javascript/easing.1.3.js) %>
<% require javascript(themes/anka/javascript/effects.js) %>
<% require javascript(themes/anka/javascript/jquery.cycle.all.min.js) %>
<% require javascript(themes/anka/javascript/jquery-ui.js) %>
<% require themedCSS(layout) %>
<% require themedCSS(news) %>
<% require themedCSS(lunch) %>
<% require themedCSS(screen) %>
<% require themedCSS(accordion) %>
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/sv_SE/all.js#xfbml=1&appId=371408952950291";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<style>
label {
display: inline-block;
width: 5em;
}
</style>
<script>
$(function() {
$( document ).tooltip({
track: true
});
});
</script>
<script>
$(function() {
$( "#accordion" ).accordion({ heightStyle: "content" });
});
</script>
<script>
$(function() {
$( "#accordion" ).accordion({
collapsible: true
});
});
</script>
<div id="Main">
<div id="ContentContainer">
$Content
$Layout
$Form
</div>
<% include rightmenu %>
</div>
<% include headermenu %>
</body>
</html>
我希望你能帮助我。因为我迷路了。
最佳答案
如果我没看错你的问题,我相信 Stop the browser from pushing everything around when I resize可能会解决你的问题。我前一段时间遇到过这个问题,我可能用过这个或者我用过
Position: Fixed;
但这又是一段时间前的事了,所以我不确定。
关于css - 浏览器调整大小打乱了布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20183889/
我的“登录”是在 IE 浏览器中进行的,登录后,如果我单击链接,它们就会在 Chrome 浏览器中打开。如何在同一个测试用例中将我当前的浏览器从 IE 切换到 Chrome。如果我创建一个 chrom
您好,我不明白在 Firefox 的内容属性中使用的特殊字符的不同显示行为。我已经剥离了一切并创造了一支笔: http://codepen.io/rpkoller/pen/Fbgav 在其“基本形式”
我正在研究 Spring Data REST,特别是 HAL 浏览器。我一直在关注 http://docs.spring.io/spring-data/rest/docs/current/refere
我正在使用工具提示,在 ie 上出现定位错误。我放了jquery浏览器代码 我的工具提示 $('.tooltip').tooltip({ position: "bottom center"
我应该如何处理蓝鸟协程中的错误? 我使用co in节点已有一段时间,它具有出色的捕获功能。 co(function*() { return new Promise(function(resol
package webviewbrowser; import java.util.List; import javafx.application.Application; import javafx.
我有一些 JavaScript 在同一域上的两个独立服务器之间共享请求。 .com 是 JavaScript 中域的要求吗? 在这种情况下,两台服务器都位于 .abc.tyy 域上,tyy 通常是 .
package webviewbrowser; import java.util.List; import javafx.application.Application; import javafx.
我正在尝试构建仍支持 NPAPI 的先前版本的 Chromium 浏览器。我已经获得了代码,并且可以使用 stand build 命令在我的 mac 上构建最新版本的 Chromium gclient
我环顾四周,找不到 browscap 的 Python 等效项(我在 PHP 中使用它来检测给定的用户代理字符串是什么浏览器。 我希望我不必自己写......:P 最佳答案 看看这个,它应该做你想要的
是否有任何 chrome 或 firefox 扩展允许 javascript 在客户端 PC 中创建写入文件? 最佳答案 你想做什么? HTML5 有一个 File API .这是最好的解决方案,因为
当我点击链接或刷新或关闭标签页时,我有这段代码会发出警报。 但我需要在关闭 窗口(选项卡)上仅 发出警报。怎么做? 我的网站上有很多外部和内部链接。
我目前正在尝试使用 Browserify + Angular,但我遇到了一个奇怪的问题。我在我的 Controller 的子目录中创建了一个名为 controllers/start-controlle
我正在为客户(项目已被接受,但现在是解释不同功能的问题)写一份详细的估算,以开发一个响应式布局的网站。 这不是我第一次进行此类开发,但这是一个关键客户,必须铺平道路。 布局将从 300px 宽度调整到
我在时事通讯上设计了一些黑底白字。由于时事通讯在打印时看起来不错且可读。我需要使布局和文本与浏览器中的内容相似。 通常情况下,黑色文本和无背景颜色是浏览器/网络邮件客户端的默认打印样式吗? 最佳答案
我有一个使用 GWT/mGWT 构建的移动友好网络应用程序。该应用程序有白色输入文本框和深灰色输入文本。但是,在 Android 浏览器上,文本显示为白色,因此是不可见的。我尝试的所有 CSS 都无法
我创建了一个带有选择输入的页面来更改正在使用的 jQuery UI 主题。当主题更改时,它会存储在 cookie 中。页面加载时,如果 cookie 存在,则恢复主题,否则加载默认主题。 当我使用 F
在我的 CSS 中,我使用了以下代码片段: word-break: break-word; -webkit-hyphens: auto; hyphens: auto; 渲染引擎如何知道在所有不同语言中
我的网络浏览器 Safari 有问题,我在 Chrome、FireFox 中测试了我的网站。 Safari 版本也是正确的,但是,当需要在 1920x1080 或更高分辨率下对其进行测试时,它无法正常
就目前情况而言,这个问题不太适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、民意调查或扩展讨论。如果您觉得这个问题可以改进并可能重新开放,visit
我是一名优秀的程序员,十分优秀!