【发布时间】:2014-03-29 12:27:48
【问题描述】:
我正在尝试使用What is the best way to move an element that's on the top to the bottom in Responsive design 为移动显示重新排序元素。 我的 html 是:
<div id="container"><div id="content" role="main">
<nav class="woocommerce-breadcrumb" itemprop="breadcrumb">
<a class="home" href="http://xxx">Home</a> / Aloe Vera Soothing Face Cream</nav>
<div itemscope itemtype="http://schema.org/Product" id="product-276" class="post-276 product type-product status-publish shipping-taxable product-type-simple instock">
<div class="images">
<a href="http://xxx/uploads/2014/03/Appeal_Aloe_Vera_Soothing_Face_Cream.jpg" itemprop="image" class="woocommerce-main-image zoom" title="Appeal Aloe Vera Soothing Face Cream" data-rel="prettyPhoto">
<img width="258" height="300"
src="http://xxx/wp-content/uploads/2014/03/Appeal_Aloe_Vera_Soothing_Face_Cream-258x300.jpg"
class="attachment-shop_single wp-post-image"
alt="Appeal Aloe Vera Soothing Face Cream"
title="Appeal Aloe Vera Soothing Face Cream" /></a>
</div>
<div class="summary entry-summary">
<h1 itemprop="name" class="product_title entry-title">Aloe Vera Soothing Face Cream</h1>
</div>
</div><!-- .summary -->
我想将产品标题“芦荟舒缓面霜”放在图片上方。 (在 HTML 中,它位于图像下方)。 我正在使用 css
@media all and (min-width: 770px){
#content div.product{
display: -webkit-box !important;
display: -moz-box !important;
display: -ms-flexbox !important;
display: -webkit-flex !important;
display: flex !important;
-webkit-box-orient: vertical !important;
-moz-box-orient: vertical !important;
-webkit-flex-direction: column !important;
-ms-flex-direction: column !important;
flex-direction: column !important;
/* optional */
-webkit-box-align: start !important;
-moz-box-align: start !important;
-ms-flex-align: start !important;
-webkit-align-items: flex-start !important;
align-items: flex-start !important;
}
#content div.product h1.product_title.entry-title{
-webkit-box-ordinal-group: 1 !important;
-moz-box-ordinal-group: 1 !important;
-ms-flex-order: 1 !important;
-webkit-order: 1 !important;
order: 1 !important;
}
#content div.product img.attachment-shop_single.wp-post-image{
-webkit-box-ordinal-group: 2 !important;
-moz-box-ordinal-group: 2 !important;
-ms-flex-order: 2 !important;
-webkit-order: 2 !important;
order: 2 !important;
}
}
但它不起作用。 (我添加了 !important 但没有帮助) 我究竟做错了什么? 谢谢
【问题讨论】:
标签: css