我有一个内部内容的div,当它溢出时我需要省略号.我已经在其他元素上多次这样做了,但由于某种原因,这不符合预期.
另外,我white-space:nowrap;故意遗漏,因为内容然后没有突破到跨度内的下一行,因此我在省略号开始之前只看到2-3个单词.我希望文本跨越父容器的整个高度,然后为超出这些边界的内容启用省略号.
这是一个有效的演示:http://jsfiddle.net/sadmicrowave/DhkSA/
CSS:
.flow-element{
position:absolute;
font-size:12px;
text-align:center;
width:75px;
height:75px;
line-height:70px;
border:1px solid #ccc;
}
.flow-element .inner{
position:absolute;
width:80%;
height:80%;
border:1px solid blue;
top:0px;
bottom:0px;
left:0px;
right:0px;
margin:auto;
text-align:center;
}
.flow-element .long{
float:left;
height:50px;
width:100%;
line-height:12px;
border:1px solid red;
text-overflow:ellipsis;
overflow:hidden;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<a class='flow-element' style='top:100px; left:50px;'>
<div class='inner'>
<span class='long'>Box 1 and some other content that should wrap and do some other stuff</span>
</div>
</a>
Run Code Online (Sandbox Code Playgroud)
有人可以请帮助.我需要在红色轮廓范围内显示尽可能多的文本,同时在文本内容溢出容器时有省略号...
提前致谢
我最近刚刚在Ubuntu 12.04服务器上安装GitLab v5.0,现在我遇到了电子邮件通知问题.我无法让GitLab发送任何类型的电子邮件.
我的config/environments/production.rb文件设置使用sendmail作为传输服务:
config.action_mailer.delivery_method = :sendmail
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
Run Code Online (Sandbox Code Playgroud)
我可以从shell中成功手动使用sendmail,如下所述:http://scratching.psybermonkey.net/2011/03/sendmail-how-to-test-sending-email.html
我的config/gitlab.yml文件设置为以下电子邮件设置:
email_from: gitlab@myops.com
Run Code Online (Sandbox Code Playgroud)
我已经读过Sidekiq没有运行可能是一个问题所以我运行了以下命令但没有任何改变..我仍然无法发送电子邮件:
$ sudo -u git -H bundle exec rake sidekiq:start RAILS_ENV=production
$ ps aux |grep -i sidekiq
git 2791 2.1 4.2 206476 86620 pts/0 Sl 14:45 0:23 sidekiq 2.7.5 gitlab [0 of 25 busy]
Run Code Online (Sandbox Code Playgroud)
这向我表明Sidekiq确实正在运行......这里还有什么问题?关于电子邮件设置,GitLab的维基似乎没有太多文档......
我发现sidekiq.log中记录了以下错误:
2013-04-24T21:09:01Z 2791 TID-1jaur8 Sidekiq::Extensions::DelayedMailer JID-21bd3ec0f086351088992396 INFO: start
2013-04-24T21:09:01Z 2791 TID-1jaur8 Sidekiq::Extensions::DelayedMailer JID-21bd3ec0f086351088992396 INFO: fail: 0.004 sec
2013-04-24T21:09:01Z 2791 TID-1jaur8 WARN: …Run Code Online (Sandbox Code Playgroud) 我正在寻找一个透明的动画加载图标; 然而(我知道我很懒)我不想自己做.如果这不是这篇文章的正确论坛,请原谅我,过去我刚刚有这么多运气.有谁知道我在哪里可以找到其中之一....它需要非常小(图标大小).
我认识到这是一个重复的问题,但是我发现与此问题有关的所有其他答案似乎都没有帮助我......
我正在安装GitLab并运行gem依赖项,当它达到NokoGirigem要求时失败并显示以下信息:
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
extconf.rb:10:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:10:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:11:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... yes
checking for xmlParseDoc()... -lxml2
checking for xsltParseStylesheetDoc()... -lxslt
-----
libxslt is missing. please …Run Code Online (Sandbox Code Playgroud) 我知道有很多关于将字符串转换为datetime已经发布的问题,但是我没有找到任何用于转换字符串的内容20120225143620,包括秒.
我试图不串-ING出每个段,并与串联执行清洁转化/和:.
有没有人有什么建议?
有没有办法可以嵌入URL链接,即<a href='www.google.com'>google</a>通过[myphonenumber] @txt.att.net发送短信?我的邮件配置设置为"text/html",但链接在SMS中显示为不可点击的纯文本...
有任何想法吗?!!?
我正在寻找一种方法让CSS(3)能够自动调整float:leftdiv和float:rightdiv 之间的中心容器div的宽度.
中心div还需要具有一min-width组的功能,类似于谷歌+ - >主页,其中中心内容自动安装在左侧导航按钮和右侧聊天窗格之间.然后,当屏幕宽度缩小超过某一点(使用javascript检测)时,聊天窗格最小化以节省空间.
这是一个活跃的模拟工作:http://jsfiddle.net/9vrby/
另外,这是我现在使用的css代码:
#left{ float:left; width:200px; height:400px; border:1px solid #000; }
#center{ float:left; width:auto; height:400px; border:1px solid red; }
#right{ float:right; width:100px; height:400px; border:1px solid blue; }
Run Code Online (Sandbox Code Playgroud)
如果您需要更多信息,请告诉我,并提前感谢您的帮助.
我在我的linux服务器上运行(生产中)mysql实例(ubuntu-10.10)但是我找不到我的mysql_config文件.
命令和输出:
~$ locate mysql_config
~$
Run Code Online (Sandbox Code Playgroud)
我听说/我需要安装libmysqlclient-dev软件包以便能够使用mysql_config,但我不想破坏我当前的生产实例.我想确保安装这个开发包不会对我当前的mysql数据库产生负面影响.
此外,在哪里可以找到libmysqlclient-dev的源代码下载以手动安装?在我目前的情况下(公司代理背后),我不允许使用apt-get.
UPDATE
这是因为尝试从源代码安装python-MySQLdb.setup.py文件需要mysql_config路径,并在尝试使用除该文件之外的任何内容时继续中断.
我在我的代码中创建了一个基本的EasterEgg,以便在使用以下代码进行以下击键时(不同时)激活Enter + c + o + l + o + r + s:
isEnter = 0; isC = 0; isO = 0; isL = 0; isR = 0; isS = 0;
$(window).keydown(function(e){
if(e.which==13) isEnter = 1; if(e.which==67) isC = 1; if(e.which==79) isO = 1;
if(e.which==76) isL = 1; if(e.which==82) isR = 1; if(e.which==83) isS = 1;
ColorMap();
});
function ColorMap(){
if(isEnter==1 && isC==1 && isO==1 && isL==1 && isR==1 && isS==1){
//DO FUNCTION//
isEnter = 0; isC = …Run Code Online (Sandbox Code Playgroud) 因此,我创建了一个自定义异常,我想以两种不同的方式调用它(if/else 语句和 try/ except 语句)。这是自定义异常:
class CustomException(Exception):
def __init__(self, value=None, *args, **kwargs):
self.parameter = value
for key, value in kwargs.items():
setattr(self, key, value)
for key, value in self.__dict__.items():
print "%s => %s" % ( key, value )
def __str__(self):
return repr(self.parameter)
Run Code Online (Sandbox Code Playgroud)
这是我想要实现自定义异常的方式:
try:
if something:
#make an error
;lsdfj
else:
raise CustomException('this is my custom message', file='somefile.txt', var2='something')
except Exception, e:
raise CustomException(e)
Run Code Online (Sandbox Code Playgroud)
我认为我的问题有两个:
NameError1:当块中抛出的标准时try/except(由于;lsdfj),我想传递CustomExceptions一些额外的参数,例如“文件”,就像if/else实现一样;我该怎么做呢?
2:当引发自定义异常时(由于 if/else 语句为 false),CustomExceptions 类最终会被调用两次,因为我在 if/else …
python error-handling if-statement exception custom-exceptions
css ×2
gitlab ×2
att ×1
autosize ×1
containers ×1
css3 ×1
datetime ×1
ellipsis ×1
email ×1
exception ×1
gem ×1
if-statement ×1
jquery ×1
keystroke ×1
libxslt ×1
loading ×1
mysql ×1
nokogiri ×1
php ×1
png ×1
python ×1
reset ×1
ruby ×1
sidekiq ×1
sms ×1
sql-server ×1
transparent ×1
ubuntu ×1
ubuntu-12.04 ×1
url ×1
variables ×1