我在Html中使用ionic framework 创建了一个简单的登录页面。
<html>
<head>
<title>Login ionic form</title>
<link rel="stylesheet" type="text/css" href="http://code.ionicframework.com/1.0.0- beta.9/css/ionic.css">
<meta name="viewport" content="width=device-width, user-scalable=no, minimal-ui">
</head>
<body>
<div class="bar bar-header bar-stable">
<h1 class="title">Welcome!</h1>
</div>
<div class="content has-header padding">
<div class="list list-inset">
<label class="item item-input">
<input type="text" placeholder="Username">
</label>
<label class="item item-input">
<input type="password" placeholder="Password">
</label>
</div>
<button class="button button-block button-positive">
Log In
</button>
<div class="row" align="center">
<div class="col col-50"><button class="button button-light">Forgot Pass? </button></div>
<div class="col col-50"><button class="button button-light"> Sign UP </button></div>
</div>
</div>
</body>
</html>
但是当我将它转换为HAML并使用sinatra运行它时,我会遇到格式问题。问题在于它切断了底部按钮。 我不知道在哪里看或理解为什么会这样。
!!!
%html
%head
%title Login ionic form
%link{href: "http://code.ionicframework.com/1.0.0-beta.9/css/ionic.css", rel: "stylesheet", type: "text/css"}/
%meta{content: "width=device-width, user-scalable=no, minimal-ui", name: "viewport"}/
%body
.bar.bar-header.bar-stable
%h1.title Welcome!
.content.has-header.padding
.list.list-inset
%label.item.item-input
%input{placeholder: "Username", type: "text"}/
%label.item.item-input
%input{placeholder: "Password", type: "password"}/
%button.button.button-block.button-positive
Log In
.row{align: "center"}
.col.col-50
%button.button.button-light Forgot Pass?
.col.col-50
%button.button.button-light Sign UP
我目前的#34;堆栈&#34;是 西纳特拉 HAML
瘦服务器/尝试过开发和生产
我的服务器&#34; app&#34;
%w[sinatra haml].each{|gem| require gem}
get '/' do
haml :index
end
HAML HTML
HAML pastebin http://pastebin.com/embed_js.php?i=sQ5Pc1YK
HTML pastebin http://pastebin.com/embed_js.php?i=DP4rSx31
答案 0 :(得分:0)
必须添加一些样式:“padding-top:xxpx; padding-top:xxpx;”在某些地方。我猜某些东西仍然在某处被打破。它看起来很好,但我感到被抢劫,因为我认为当我从HTML转换时,一切都会正确格式化。 HAML。