Wordpressでflexboxを使って要素を横並びにしたいのですが、うまくいきません。
どうしたらいいでしょうか。
テーマはtwentyseventeenを使っています。
「index.php」
<!-- randomPostBox --> <section id="randomPostBox"> <!-- ランダム記事表示 --> <?php $loop = new WP_Query('showposts=4&orderby=rand'); while ( $loop->have_posts() ) : $loop->the_post(); ?> <div class="box"> <p><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?><br><?php the_title(); ?></a></p> </div> <?php endwhile;wp_reset_query(); ?> </section> <!-- randomPostBox -->
「CSS」
* { margin:0 !important; padding:0 !important; } body { margin:0 !important; width:1000px; } img { vertical-align:bottom !important; } header { width:1000px; } #randomPostBox { width:600px; display: -webkit-flex; display: -moz-flex; display: -ms-flex; display: -o-flex; display: flex; }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/10/16 09:37