jquery - 具有透明背景的代码联系表

标签 jquery html css

我正在尝试编写一个与此主题保持一致但似乎无法掌握的联系表。有没有人介意帮帮我。基本上我希望这些框具有黑色透明背景,如联系方法 div 和白色文本。我希望表单位于页面的中心,就在 contact-content-container div 的下方。希望这是有道理的——我可能把事情弄糊涂了,这就是为什么我不能让它工作的原因。这是我到目前为止的地方......

HTML 是:

<div class="contact-container">
<div class="contact-title">HOW TO GET IN TOUCH</div>
<div class="contact-content-container">
<div class="contact-method">
<div class="contact-method-image"></div>
<div class="contact-header"><strong>Address</strong></div>
<div class="contact-copy">
<p>test</p>
</div>
<div class="contact-copy">
<p>test</p>
</div>
<div class="contact-copy">
<p>test</p>
</div>
</div>
<div class="contact-method">
<div class="contact-method-image"></div>
<div class="contact-header"><strong>Phone</strong></div>
<div class="contact-copy">
<p>Phone: </p>
</div>
<div class="contact-copy">
<p>Mobile: </p>
</div>
<div class="contact-copy">
<p>Skype: skype</p>
</div>
</div>
<div class="contact-method">
<div class="contact-method-image"></div>
<div class="contact-header"><strong>Mail</strong></div>
<div class="contact-copy">
<p>test</p>
</div>
<div class="contact-copy">
<p>test</p>
</div>
<div class="contact-copy">
</div>
</div>
<div style="clear:both;"></div>
</div>
</div>

CSS 是:

.contact-container {
height: 500px;
width: 100%;
float: left;
z-index: -1000;
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
background-image: url(../images/contact_background.png);
background-position: center;
background-size: cover;
}

.contact-title {

text-align: center;
width: 100%;
margin-bottom: 10px;
margin-top: 40px;
font-size: 30px;
height: auto;
font: 200 18px/1.3 'Roboto', 'Helvetica Neue', 'Segoe UI Light', sans-serif;
font-size: 30px;
font-weight: 200;
color:#FFF;
}

.contact-content-container {
height: auto;
width: 100%;
margin-left: auto;
margin-right: auto;
margin-top: 20px
}

.contact-method {
width: 31%;
height: 192px;
float: left;
margin-left: 20px;
background: rgba(0,0,0,.5);
}   

.contact-method-image {
width: 38px;
height: 50px;
background-image: url(../images/location_icon.png);
margin-right: auto;
margin-left: auto;
margin-top: 20px;
margin-bottom: 20px;
opacity:0.4;
}

.contact-copy {
height:auto;
width:100%;
text-align:center;
margin-top:2px;
color:#FFF;

}

.contact-header {
height:auto;
width:100%;
text-align:center;
margin-bottom:10px;
color:#FFF;

}

提前致谢

最佳答案

不完全确定您在寻找什么...我认为一个问题是我们看不到您在 css 中引用的图像,因为它们是本地的。也许这会帮助您朝着正确的方向前进?

<html>
<head>
<style>
.contact-container {
height: 500px;
width: 100%;
float: left;
z-index: -1000;
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
background-image: url(../images/contact_background.png);
background-position: center;
background-size: cover;
}

.contact-title {

text-align: center;
width: 100%;
margin-bottom: 10px;
margin-top: 40px;
font-size: 30px;
height: auto;
font: 200 18px/1.3 'Roboto', 'Helvetica Neue', 'Segoe UI Light', sans-serif;
font-size: 30px;
font-weight: 200;
color:#FFF;
}

.contact-content-container {
height: auto;
width: 100%;
margin-left: auto;
margin-right: auto;
margin-top: 20px
}

.contact-method {
width: 31%;
height: 192px;
float: left;
margin-left: 20px;
background: rgba(0,0,0,.5);
}   

.contact-method-image {
width: 38px;
height: 50px;
background-image: url(../images/location_icon.png);
margin-right: auto;
margin-left: auto;
margin-top: 20px;
margin-bottom: 20px;
opacity:0.4;
}

.contact-copy {
height:auto;
width:100%;
text-align:center;
margin-top:2px;
color:#FFF;

}

.contact-header {
height:auto;
width:100%;
text-align:center;
margin-bottom:10px;
color:#FFF;

}

form{
width:800px;
margin: 20px auto;
color:#FFF;
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
background-color: rgba(0,0,0,.5);
padding:1em;
}


.row{
float:left;
clear:both;
width:100%;
}

.button-row{
float:left;
clear:both;
width:100%;
padding-right:10%;
text-align:right;
}

.label{
    width:35%;
    float:left;
    text-align:right;
}

.input{
    width:63%;
    margin-left:2%;
    float:left;
}

</style>
</head>
<body>
<div class="contact-container">
    <div class="contact-title">HOW TO GET IN TOUCH</div>
    <div class="contact-content-container">
        <div class="contact-method">
            <div class="contact-method-image"></div>
            <div class="contact-header"><strong>Address</strong></div>
            <div class="contact-copy">
                <p>test</p>
            </div>
            <div class="contact-copy">
                <p>test</p>
            </div>
            <div class="contact-copy">
                <p>test</p>
            </div>
        </div>
        <div class="contact-method">
            <div class="contact-method-image"></div>
            <div class="contact-header"><strong>Phone</strong></div>
            <div class="contact-copy">
                <p>Phone: </p>
            </div>
            <div class="contact-copy">
                <p>Mobile: </p>
            </div>
            <div class="contact-copy">
                <p>Skype: skype</p>
            </div>
        </div>
        <div class="contact-method">
            <div class="contact-method-image"></div>
            <div class="contact-header"><strong>Mail</strong></div>
            <div class="contact-copy">
                <p>test</p>
            </div>
            <div class="contact-copy">
                <p>test</p>
            </div>
            <div class="contact-copy">
            </div>
        </div>
        <div style="clear:both;"></div>
    </div>
    <div>
        <form action="#">
            <div class="row">
                <label class="label" for="first_name">First Name:</label>
                <div class="input">
                    <input type="text" name="first_name"/>
                </div>
            </div>
            <div class="button-row">
                <input type="submit"/>
            </div>
            <div style="clear:both;"></div>
        </form>
    </div>
</div>
</body>
</html>

关于jquery - 具有透明背景的代码联系表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28289016/

相关文章:

javascript - 停止事件在 deferred.reject 上继续

javascript - 如何通过 npm jquery-ui-datepicker-with-i18n 导入到 laravel?

html - 如何使 “text-overflow: ellipsis” 与另一个 float 元素一起工作

jquery - 可扩展面板将列向下推到平板设备上

html - 如何将图片放在导航栏的左侧?

php - Wordpress, slider 中的最新帖子

javascript - 制作带有延迟的循环 slider

javascript - 如果值发生变化,如何使 Bootstrap 按钮大小(宽度 * 高度)保持不变?

javascript - 单击 Div 向右滚动

javascript - 在特定位置添加 <li>