【发布时间】:2016-07-19 22:59:17
【问题描述】:
请看我的练习网站-http://codepen.io/silentarrowz/pen/rLJABR
我遇到了一些问题:
在缩小屏幕尺寸时,顶部的 eElectronics 和购物车未居中,而是出现在屏幕的一侧。我希望它以小屏幕尺寸为中心。我可以将 eElectronics 徽标居中,但无法将购物车 div 居中,即使我正在使用媒体查询。
对于小屏幕尺寸,导航栏会溢出,并且末尾的链接(例如 OTHERS 和 CONTACT)会流到下一行。我该如何解决这个问题?
轮播标题移出屏幕以减小尺寸。我该如何解决这个问题?
请提出您的建议和意见。
.navcolor{
background-color:#1abc9c;
}
.logo a{
padding-bottom:10px;
color:#999;
}
.logo a span{
color:#1abc9c;
}
.cart {
border:1px solid rgb(221,221,221);
font-family:"Titillium Web";
font-size:18px;
width:140px;
height:50px;
padding-top:10px;
padding-left:10px;
}
.cart a{
color:#666;
}
.cart a span{
color:#1abc9c;
font-weight:bold;
}
.cart:hover {
background-color : #1abc9c;
}
.cart:hover span, .cart:hover a{
color:white;
}
.no-underline :hover{
text-decoration:none;
}
.navbar-default .navbar-menu{
height:50px;
}
.navbar-default .navbar-menu li > a{
color:white;
font-weight:bold;
font-size:14px;
}
.navbar-default .navbar-menu > .active > a {
background-color:#333;
color:white;
}
.navbar-default .navbar-menu > .active > a:hover {
background-color:#333;
color:white;
}
.navbar-default .navbar-menu li>a:hover{
background-color:#333;
color:white;
}
#carousel1 img{
width:100%;
height:70%;
}
.logo{
font-family:"Titillium Web";
font-size:40px;
}
.cart{
font-size:18px;
}
.carouse-inner{
position:relative;
}
.carousel-caption{
background-color:rgba(0,0,0,0.5);
color:white;
display:block;
width:600px;
padding-left:20px;
text-align:left;
position:absolute;
left:600px;
bottom:150px;
}
.latest img{
border:1px solid grey;
}
.details p{
height:150px;
display:block;
border:1px solid #17a78b;
margin-top:30px;
margin-bottom:30px;
padding-top:10px;
padding-bottom:10px;
font-size: 30px;
font-weight:200;
color:#fff;
text-align:center;
}
.details p:hover{
background-color:black;
}
.details p>i{
font-size:50px;
font-weight:500;
}
.details{
background-color:rgb(26,188,156);
}
.latest{
text-align:center;
}
@media (max-width: 300px) {
.logo{
text-align:center;
}
.cart{
width:100%;
text-align: center;
}
}
@media (min-width: 501px) {
.logo {
float: left;
}
.cart {
float:right;
}
}
【问题讨论】:
-
如果我们解决了您的问题,请投票给答案或给我们一些反馈!
标签: html css media-queries responsive