- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
如何向上移动按钮:+、<、垃圾桶,同时级别不会被重新定位或在此过程中离开表单?
我尝试了各种策略,例如使用 float 、填充、边距、文本对齐,但似乎没有一个能正确完成工作。
// Place all the styles related to the Values controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.america {
padding-top: 1.5em;
padding-bottom: 1.5em;
padding-left: 1.2em;
padding-right: 1.2em;
}
.missed {
text-align: right;
color: #c0392b;
font-weight: bold;
clear: both;
}
.collection_check_boxes {
margin-left: 3px;
margin-right: 6px;
}
.committed {
text-align: center;
}
.america2 {
padding-top: .7em;
}
.btn-group {
background: #c0392b;
border: #000;
border-radius: 8px;
font-family: verdana, arial, helvetica, sans-serif;
color: #ffffff;
font-size: 15px;
padding: 8px 18px 8px 18px;
text-decoration: none;
}
.category {
width: 8%
}
.valuation {
width: 70%
}
td {
padding-top: .7em;
padding-bottom: .7em;
padding-left: .7em;
padding-right: .7em;
}
.btn {
background: #c0392b;
border: #000;
border-radius: 8px;
font-family: verdana, arial, helvetica, sans-serif;
color: #ffffff;
font-size: 15px;
padding: 8px 18px 8px 18px;
text-decoration: none;
}
f.text_field {
margin: 5px 5px 0px 5px;
}
.btn:hover {
background: #3cb0fd;
background-image: -webkit-linear-gradient(top, #3cb0fd, #3498db);
background-image: -moz-linear-gradient(top, #3cb0fd, #3498db);
background-image: -ms-linear-gradient(top, #3cb0fd, #3498db);
background-image: -o-linear-gradient(top, #3cb0fd, #3498db);
background-image: linear-gradient(to bottom, #3cb0fd, #3498db);
text-decoration: none;
}
.btn:active{
color: #FFFFFF;
}
.valuations-button {
margin-top : -9px;
margin-left : 10px;
}
<%= simple_form_for(@habit) do |f| %>
<%= f.error_notification %>
<div class="america">
<form>
<div class="committed">
<%= f.label "Committed to:" %>
<%= f.collection_check_boxes :committed, Date::DAYNAMES, :downcase, :to_s %>
</div>
<p><div class="date-group">
<label> Started: </label>
<%= f.date_select :date_started, :order => [:month, :day, :year], class: 'date-select' %>
</div></p>
<p><%= f.text_field :trigger, class: 'form-control', placeholder: 'Enter Trigger' %></p>
<p><%= f.text_field :action, class: 'form-control', placeholder: 'Enter Action*' %></p>
<p><%= f.text_field :target, class: 'form-control', placeholder: 'Enter Target' %></p>
<p><%= f.text_field :positive, class: 'form-control', placeholder: 'Enter Pos. Reward' %></p>
<%= f.text_field :negative, class: 'form-control', placeholder: 'Enter Neg. Consequence' %>
<div class="missed">
<%= f.label "Level 1:" %>
<%= f.collection_check_boxes :missed, Habit::ONEMISSED, :downcase, :to_s %>
</br>
<%= f.label "Level 2:" %>
<%= f.collection_check_boxes :missed, Habit::TWOMISSED, :downcase, :to_s %>
</br>
<%= f.label "Level 3:" %>
<%= f.collection_check_boxes :missed, Habit::THREEMISSED, :downcase, :to_s %>
</br>
<%= f.label "Level 4:" %>
<%= f.collection_check_boxes :missed, Habit::FOURMISSED, :downcase, :to_s %>
</br>
<%= f.label "Level 5:" %>
<%= f.collection_check_boxes :missed, Habit::FIVEMISSED, :downcase, :to_s %>
</br>
</div>
<div class="america2">
<%= button_tag(type: 'submit', class: "btn") do %>
<span class="glyphicon glyphicon-plus"></span>
<% end %>
<%= link_to habits_path, class: 'btn' do %>
<span class="glyphicon glyphicon-chevron-left"></span>
<% end %>
<%= link_to @habit, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn' do %>
<span class="glyphicon glyphicon-trash"></span>
<% end %>
</div>
<% end %>
</form>
</div>
</div>
最佳答案
不确定您是否尝试过 CSS 定位。假设您想要相对于表单元素向上移动按钮。
form {
position: relative;
}
.america2 {
position: absolute;
bottom: 50px; /* positioned 50px relative to bottom of the form */
left: 0;
}
关于html - 如何将 <div> 定位到左侧,将 <div> 定位到右侧(不偏离表格)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28466991/
似乎这是不可能的,但如果有人提示如何在谷歌浏览器中创建右侧边栏(如 iframe),任何提示都会有所帮助。谢谢。 最佳答案 如果你的意思是这样的 这是来自 google chrome 实验 api:
您好,我在用 C 语言解决编程任务时遇到问题。 The funktion "Trim" should replace all spaces at the end of a String with nu
有什么方法可以找到一个事件(或属性或方法或类似的东西)来检测窗口停靠到左侧或右侧吗? 描述: 通过 WindowState 属性,您可以了解当您的窗口在正常/最小化/最大化这三种状态之间改变状态时。在
我目前需要找到一个算法来确定一个点是在圆弧的右侧还是左侧。 这是以下算法的扩展以包含弧: // isLeft(): tests if a point is Left|On|Right of an i
我正在使用 Selenium 执行测试,该测试在 3 个浏览器上并行执行。我想以下一种方式定位 window :左侧,右侧和底部,所以基本上我正在寻找与 (start btn+left btn...)
如果我有下面的代码,并且我想插入一个带有 jquery 的 div 作为表单标记内的第一个元素,那么最好的方法是什么? //i want to insert a div here with
有没有比这个更好的方法来解决这个问题? def 渲染(arr): single_elements = [] double_elements = [] for i in xrange(len(arr
Home About
我遇到的问题是: www.dondolomemories.it 当调整窗口大小时, Logo 图像直到最后一刻才调整大小,导致可怕的两行菜单溢出。 我花了将近 2 个小时尝试大量不同的设置。有人可以帮
我希望我能很好地解释这一点。我有一个 style="float: right;"的 div在这个 div 中,我有一个包含一些编辑器字段的表。但现在我想要两个文本编辑器框(在 .NET MVC3 @H
如果有人能帮助我解决这个问题,我将不胜感激,因为我无法让它工作。 这是我正在努力处理的代码:http://jsfiddle.net/sp91c3nk/ 基本上,我希望右侧导航栏与灰色主要内容区域处于同
我正在尝试在图像的所有四个边上添加文本,但我无法让正确的文本正确对齐。右边的文字仍然在左边。 fiddle :https://jsfiddle.net/y75L0ww9/ Text on top Te
我正在尝试为顶部以及左侧和右侧设置 css 阴影,但高度降低。我熟悉模糊/半径,但我希望阴影非常短。 picture from wix template (还不能上传,抱歉) 有人可以帮帮我吗?我看到
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 6 年前。 Improve
请看这个jsfiddle . 我想要 与 innerText “嗨!”始终出现在其包含父级的可见部分的底部/右侧。它不应与其父级的内容一起滚动。 HTML: Header
我有一个输入框和一个提交按钮。 当我向右浮动提交按钮时,我希望它在与输入字段相同的点结束 - 这是我的意思的一个例子:http://prntscr.com/aggln5 目前,输入和提交在不同的点结束
我基本上刚刚开始让我的网站响应,但出于某种原因,语言 div (#lang) 设置为向右浮动,正在向右浮动,但在它的右侧有一个小边距。虽然没有填充设置父 div #container,但我无法理解。
我目前正在创建一个网站,该网站有一个带有文本等内容的居中框。现在,我还想要一个漂浮在右边的盒子,与我的主盒子有一点缝隙。留个图吧,我画的红框就是我要制作的 float 框。 顺便说一句。蓝色方框只是我
我不是 UI 开发人员,但这次需要玩 css。为用户配置文件编写表单。我快完成了,但还有一个小问题。问题 个人资料图片未正确显示在右侧。 因此,第一个字段(组织名称)显示不正确 自从过去两个小时以来,
我有以下脚本: http://jsfiddle.net/rYFEY/12/ 效果很好,除了我需要移除右侧和右下角的 handle ,只留下底部 handle 用于调整大小。目前,如果我点击右 hand
我是一名优秀的程序员,十分优秀!