我想将所有 div 居中,所以当屏幕变小时,它会保持居中并变小
这是小提琴链接:http: //jsfiddle.net/h6253/1/
代码示例:
#first_section {
width: 0 auto;
height: 776px;
font-family: 'Raleway', sans-serif;
}
#square {
width: 857px;
height: 4px;
background-color: #2a2d2f;
margin-bottom: 10px;
}
#first_section_txt {
position: relative;
width: 997px;
height: 164px;
margin-left: 500px;
margin-top: 251px;
}
.clear_both {
clear: both;
}
h1 { font-family: 'Source Code Pro', sans-serif;
font-weight: 500;
font-size: 111px;
display: inline;
color: #4a4949;
}
h2 { font-family: 'Source Code Pro', sans-serif;
font-weight: 400;
font-size: 111px;
display: inline;
color: #c0c0c0;
}
h3 { font-family: 'Source Code Pro', sans-serif;
font-weight: 200;
font-size: 25px;
display: inline;
color: #a7a7a7;
padding-left: 350px;
top: 15px;
}
h3{
text-shadow: 2px 2px 2px rgba(150, 150, 150, 0.37);
}
#first_section img {
position: relative;
margin-left: 525px;
width: 466px;
height: 540px;
margin-top: -150px;
}