这是我迄今为止的工作:
<div id="main">
<form>
<label>First Name:<input type="text" id="firstname"></label><br/>
<label>Last Name:<input type="text" id="lastname"></label><br>
<label>E-Mail:<input type="text" id="email"></label><br/>
<label>Phone:<input type="text" id="phone"></label><br/>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
#main {
width:300px;
}
#main input {
float:right;
display:inline;
}
#main label {
color: #2D2D2D;
font-size: 15px;
width:250px;
display: block;
}
Run Code Online (Sandbox Code Playgroud)
目前,标签(在左侧)有点朝向输入字段的顶部(在右侧).我想垂直对齐它们所以标签,因为在输入字段的中间.
我试过了vertical-align,它不起作用.请帮我解决问题.谢谢.
我的页面中央有一个下拉按钮,但是当我单击下拉列表时,实际的下拉部分仍然位于页面的左侧.有什么问题?
HTML
<div class="row">
<div class="col-md-12 school-options-dropdown">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Choose a School
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#">Add your school</a></li>
<li><a href="#">Hello</a></li>
</ul>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
div.school-options-dropdown {
text-align: center;
}
.dropdown {
text-align:center;
}
.dropdown-menu {
text-align: center;
}
Run Code Online (Sandbox Code Playgroud) 使用CSS,
如下所示:http: //gyazo.com/ff14a415cf7ac8622eb0cada3e23137f
我想要CSS(最好不是CSS3)让边缘和角落产生这种效果,而不仅仅是尖锐的egdes.
该网站的功能是发布博客文章.它在Windows 7上本地运行.我试过Paperclip gem(版本4.2.4和4.3),服务器进入cmd的无限循环(4.2.4上没有发生,但仍然得到错误).我做了捆绑安装,它肯定是安装的.
的Gemfile:
gem "paperclip", "~> 4.3"
Run Code Online (Sandbox Code Playgroud)
这是模型:
class Post < ActiveRecord::Base
has_attached_file :image, :default_url => ":style/rails1.jpg"
validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
end
Run Code Online (Sandbox Code Playgroud)
这是我在尝试提交图片(png或jpg)时遇到的错误:
图像的内容不是报告的内容
我是新手,所以详细的解释将不胜感激.我在这里阅读了一些其他修复但没有任何效果.
按照这个 heroku教程在heroku上启动应用程序.但是当我使用命令时heroku create,它说它不被识别.我加入C:\Program Files\Heroku了我的PATH.我该如何解决?
基本上我正在将容器推入一个数组,一旦推出一个,我不想再允许同一个容器.
这是我的JSfiddle:http://jsfiddle.net/9Dmcg/3/
使用Javascript:
$(document).ready(function(){
var favorites = [];
var counter = 0;
$('.containers').on('click', function(){
favorites.push($(this).clone())
$('.favorite').append(favorites);
});
});
Run Code Online (Sandbox Code Playgroud)
我需要找到解决这个问题的方法.
我有一个哈希,其值是一个歌词数组(line1,line2等...)
码:
class Song
def initialize(lyrics)
@lyrics = lyrics
end
def get_song_name()
puts @lyrics.keys
end
def get_first_line()
puts @lyrics.values[0]
end
end
wasted = Song.new({"Wasted" => ["I like us better when we're wasted",
"It makes it easier to see"]})
real_world = Song.new("Real World" => ["Straight up what do you want to learn about here", "if i was someone else would this all fall apart"])
wasted.get_song_name()
wasted.get_first_line()
#=>I like us better when we're wasted
#=>It makes it easuer to see
Run Code Online (Sandbox Code Playgroud)
所以当我打电话时wasted.get_first_line …
我有以下脚本,可以在终端中运行时运行:
所做的就是将麦克风语音转换为文本。
import speech_recognition as sr
# obtain audio from microphone
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
audio = r.listen(source)
try:
# for testing purposes, we're just using the default API key
# to use another API key, use `r.recognize_google(audio, key="GOOGLE_SPEECH_RECOGNITION_API_KEY")`
# instead of `r.recognize_google(audio)`
print("Google Speech Recognition thinks you said " + r.recognize_google(audio))
except sr.UnknownValueError:
print("Google Speech Recognition could not understand audio")
except sr.RequestError as e:
print("Could not request results from Google Speech Recognition service; {0}".format(e)) …Run Code Online (Sandbox Code Playgroud) 出于某种原因,我做到了,所以我的文字(A)是主动被加粗,但它被点击我的鼠标,当它从点击释放时才会被激活,它会关闭和文字可以追溯到它的正常状态.
为什么是这样?
如果你到了MSN,请查看他们搜索栏上方的文字.当您单击它时,它会变为粗体并变为橙色.不离开页面.这就是我想要做的.
HTML:
<div id="searchtopics">
<ul>
<li><a href="#">Web</a> </li>
<li><a href="#">MSN</a> </li>
<li><a href="#">Images</a> </li>
<li><a href="#">Video</a> </li>
<li><a href="#">News</a> </li>
<li><a href="#">Maps</a> </li>
<li><a href="#">Shopping</a> </li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
#searchtopics {
position:absolute;
margin-left:208px;
margin-top:38px;
}
#searchtopics a {
text-decoration:none;
float:left;
padding: 2px 6px 4px 6px;
color:rgb(100,100,100);
}
#searchtopics a:hover{
text-decoration:underline;
}
#searchtopics a:active{
color:rgb(100,100,100);
font-weight:bold;
}
#searchtopics ul {
display:inline;
list-style:none;
}
#searchtopics ul li {
display:inline;
color:rgb(100,100,100);
font-family:"arial", times, sans-serif;
font-size:12px;
}
Run Code Online (Sandbox Code Playgroud) 我有两个包含人物信息的数组:
brad = ["Brad", 16]
andrew = ["Andrew", 43]
Run Code Online (Sandbox Code Playgroud)
可以通过以下方式找到更大的数字:
max_num = [brad[1], andrew[1]].max
Run Code Online (Sandbox Code Playgroud)
我希望将名称与最大值匹配,所以我可以说
puts "The max is #{max_num} and the record setter is #{name}"
Run Code Online (Sandbox Code Playgroud)
我将如何实现这一目标?这必须适用于列出的两个以上的数组,因此答案if max_num == brad[1] else等不起作用.