草庐IT

html - 右边框不显示

coder 2023-08-01 原文

你知道为什么我的字段右侧没有显示蓝色边框吗? (字段宽度为 100%)非常感谢 http://jsfiddle.net/KtEdG/

CSS:

.wrapper {
    position: relative;
    display: block;
    margin-right: auto;
    margin-left: auto;
    width: 1000px;
    overflow: hidden;

}


.block {    
    padding: 20px;
    background-clip: border-box;
    box-sizing: border-box;
    -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;


}

.block-left {
    float: left;
    box-sizing: border-box;
        overflow: hidden;

    width: 50%;

}
.block-right {
    float: right;
    overflow: hidden;
    box-sizing: border-box;
    width: 50%;


}

/*************************************************************
 * CONTACT
 *************************************************************/
.contact-form input[type=text] {
    float: left;
    width: 200px;
}
.contact-form input[type=email] {
    float: right;
    width: 200px;
}
.contact-form input[type=submit] {
    float: right;
    margin-top: 8px;
}
.contact-form textarea {
    float: left;
    margin-top: 20px;
    margin-bottom: 10px;
    width: 100%;
    height: 70px;
    overflow: auto;
}
/*************************************************************


/*************************************************************
 * FORMS
 *************************************************************/
form label {
    cursor: pointer;
}
form textarea, form input[type=text], form input[type=password], form input[type=email] {
    padding: 6px 8px;
    border-top: 1px solid transparent;
    border-right: 1px solid #d2d2d2;
    border-bottom: 1px solid transparent;
    border-left: 1px solid #d2d2d2;
    background: #d5d5d5 url('../images/form-bg.png') left top repeat-x;
    color: #7c7c7c;
    font-family: 'Arial', sans-serif;
    resize: none;
}
form input:focus, form textarea:focus {
    outline: none;
    border: 1px solid #0069BA;
    background: #d5d5d5 none;
}
form input[type=submit] {
    padding: 8px 50px;
    border: 0;
    background: #0064C4 url('../images/form-caret.png') right center no-repeat;
    color: #fff;
    text-transform: uppercase;
    font-weight: normal;
    font-size: 14px;
    font-family: 'Arial', sans-serif;
    cursor: pointer;
}



#addressbox {
    position: relative;
    padding: 10px 0px 0 10px;
    margin-bottom: 20px;
}
#addressbox p {

    line-height: 14px;
}
#contact li {
    display: inline;
    padding-right: 5px;
    color: #333;
    list-style: none;
    font-weight: 500;
    font-size: 13px;
}
#contact li a {
    border-bottom: none;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
}

HTML

<div class="wrapper white-background">
            <div class="block">
          <div class="block-left">
            <div id="addressbox">
              <p><strong>fdsfsd</strong></p>
              <p>3, rudsfdser</p>
              <p> L53ddfsfurg)</p>
              <ul id="contact" class="ul-none">
                <li><i class="fa fa-phone blue"></i> +352 691 123.456</li>
                <li><i class="fa fa-envelope blue"></i> <a href="javascript:sendAnnotatedMailTo('contact','bfdfs','dfsf','Contact via blondiau.lu','')">contact@fdsfdssd.lu</a></li>
                <li><i class="fa fa-map-marker blue"></i><a href="http://goo.gl/I47" target="_blank"> Plan d'accès</a></li>
              </ul>

            <div class="contactarrow"><img src="images/contact-handwriting.png" alt="contact-handwriting" width="339" height="69"></div></div>
            <!-- End DIV addressbox --> 
                      </div>
          <!-- End DIV block-left -->

          <div class="block-right"> 
            <!-- CONTACT FORM-->
            <div class="contact-form">
              <form id="contactfrm" method="post" class="clearfix">
                <div class="clearfix">
                  <input id="name" name="name" placeholder="Nom" type="text" value="">
                  <input id="email" name="email" placeholder="Email" type="email" value="">
                </div>
                <textarea id="message" name="message" placeholder="Votre message et vos coordonnées"></textarea>
                <input type="submit" value="Envoyer" name="submit">
                <p class="success" style="display:none">Votre message a bien été envoyé! Merci</p>
                <p class="error" style="display:none;">E-mail non valide et/ou message vide</p>
              </form>
            </div>
            <!-- /.contact-form --> 

最佳答案

因为你的 textarea溢出.block-right并且由于您使用的是 overflow: hidden;您看不到 textarea 的正确部分, 你可以分配一些固定的 width喜欢

.contact-form textarea {
    float: left;
    margin-top: 20px;
    margin-bottom: 10px;
    width: 462px;
    height: 70px;
    overflow: auto;
}

Demo

或者如果你想坚持width: 100%比你必须摆脱overflow: hidden;来自 .block-right

Demo 2

另外,你有很多 CSS,它们可能没有用,所以代码通常非常困惑。


此外,刚刚注意到,您正在使用 box-sizing属性,但你没有使用前缀属性,所以它在许多浏览器中会失败,所以使用它们

.block {    
    padding: 20px;
    background-clip: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    /* Other Properties */
}

Demo

关于html - 右边框不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20813899/

有关html - 右边框不显示的更多相关文章

  1. ruby - 使用 ruby​​ 将 HTML 转换为纯文本并维护结构/格式 - 2

    我想将html转换为纯文本。不过,我不想只删除标签,我想智能地保留尽可能多的格式。为插入换行符标签,检测段落并格式化它们等。输入非常简单,通常是格式良好的html(不是整个文档,只是一堆内容,通常没有anchor或图像)。我可以将几个正则表达式放在一起,让我达到80%,但我认为可能有一些现有的解决方案更智能。 最佳答案 首先,不要尝试为此使用正则表达式。很有可能你会想出一个脆弱/脆弱的解决方案,它会随着HTML的变化而崩溃,或者很难管理和维护。您可以使用Nokogiri快速解析HTML并提取文本:require'nokogiri'h

  2. ruby-on-rails - Rails 编辑表单不显示嵌套项 - 2

    我得到了一个包含嵌套链接的表单。编辑时链接字段为空的问题。这是我的表格:Editingkategori{:action=>'update',:id=>@konkurrancer.id})do|f|%>'Trackingurl',:style=>'width:500;'%>'Editkonkurrence'%>|我的konkurrencer模型:has_one:link我的链接模型:classLink我的konkurrancer编辑操作:defedit@konkurrancer=Konkurrancer.find(params[:id])@konkurrancer.link_attrib

  3. ruby - 解析 RDFa、微数据等的最佳方式是什么,使用统一的模式/词汇(例如 schema.org)存储和显示信息 - 2

    我主要使用Ruby来执行此操作,但到目前为止我的攻击计划如下:使用gemsrdf、rdf-rdfa和rdf-microdata或mida来解析给定任何URI的数据。我认为最好映射到像schema.org这样的统一模式,例如使用这个yaml文件,它试图描述数据词汇表和opengraph到schema.org之间的转换:#SchemaXtoschema.orgconversion#data-vocabularyDV:name:namestreet-address:streetAddressregion:addressRegionlocality:addressLocalityphoto:i

  4. ruby-on-rails - Rails HTML 请求渲染 JSON - 2

    在我的Controller中,我通过以下方式在我的index方法中支持HTML和JSON:respond_todo|format|format.htmlformat.json{renderjson:@user}end在浏览器中拉起它时,它会自然地以HTML呈现。但是,当我对/user资源进行内容类型为application/json的curl调用时(因为它是索引方法),我仍然将HTML作为响应。如何获取JSON作为响应?我还需要说明什么? 最佳答案 您应该将.json附加到请求的url,提供的格式在routes.rb的路径中定义。这

  5. ruby-on-rails - 使用 Sublime Text 3 突出显示 HTML 背景语法中的 ERB? - 2

    所以我在关注Railscast,我注意到在html.erb文件中,ruby代码有一个微弱的背景高亮效果,以区别于其他代码HTML文档。我知道Ryan使用TextMate。我正在使用SublimeText3。我怎样才能达到同样的效果?谢谢! 最佳答案 为SublimeText安装ERB包。假设您安装了SublimeText包管理器*,只需点击cmd+shift+P即可获得命令菜单,然后键入installpackage并选择PackageControl:InstallPackage获取包管理器菜单。在该菜单中,键入ERB并在看到包时选择

  6. ruby-on-rails - link_to 不显示任何 rails - 2

    我试图在索引页中创建一个超链接,但它没有显示,也没有给出任何错误。这是我的index.html.erb代码。ListingarticlesTitleTextssss我检查了我的路线,我认为它们也没有问题。PrefixVerbURIPatternController#Actionwelcome_indexGET/welcome/index(.:format)welcome#indexarticlesGET/articles(.:format)articles#indexPOST/articles(.:format)articles#createnew_articleGET/article

  7. ruby-on-rails - 如何在 Rails View 上显示错误消息? - 2

    我是rails的新手,想在form字段上应用验证。myviewsnew.html.erb.....模拟.rbclassSimulation{:in=>1..25,:message=>'Therowmustbebetween1and25'}end模拟Controller.rbclassSimulationsController我想检查模型类中row字段的整数范围,如果不在范围内则返回错误信息。我可以检查上面代码的范围,但无法返回错误消息提前致谢 最佳答案 关键是您使用的是模型表单,一种显示ActiveRecord模型实例属性的表单。c

  8. ruby-on-rails - Ruby url 到 html 链接转换 - 2

    我正在使用Rails构建一个简单的聊天应用程序。当用户输入url时,我希望将其输出为html链接(即“url”)。我想知道在Ruby中是否有任何库或众所周知的方法可以做到这一点。如果没有,我有一些不错的正则表达式示例代码可以使用... 最佳答案 查看auto_linkRails提供的辅助方法。这会将所有URL和电子邮件地址变成可点击的链接(htmlanchor标记)。这是文档中的代码示例。auto_link("Gotohttp://www.rubyonrails.organdsayhellotodavid@loudthinking.

  9. ruby-on-rails - capybara ::ElementNotFound:无法找到 xpath "/html" - 2

    我正在学习http://ruby.railstutorial.org/chapters/static-pages上的RubyonRails教程并遇到以下错误StaticPagesHomepageshouldhavethecontent'SampleApp'Failure/Error:page.shouldhave_content('SampleApp')Capybara::ElementNotFound:Unabletofindxpath"/html"#(eval):2:in`text'#./spec/requests/static_pages_spec.rb:7:in`(root)'

  10. ruby-on-rails - 复数 for fields_for has_many 关联未显示在 View 中 - 2

    目前,Itembelongs_toCompany和has_manyItemVariants。我正在尝试使用嵌套的fields_for通过Item表单添加ItemVariant字段,但是使用:item_variants不显示该表单。只有当我使用单数时才会显示。我检查了我的关联,它们似乎是正确的,这可能与嵌套在公司下的项目有关,还是我遗漏了其他东西?提前致谢。注意:下面的代码片段中省略了不相关的代码。编辑:不知道这是否相关,但我正在使用CanCan进行身份验证。routes.rbresources:companiesdoresources:itemsenditem.rbclassItemi

随机推荐