我试图将标题从容器中取出,以便我可以使标题拉伸屏幕的整个宽度(在实现容器之前,我已经将它弄乱了好几个小时而没有运气正在阻止它)。这是HTML:
</head>
<body <?php body_class(); ?>>
<div id="wrapper">
<div id="header">
<div class="container clearfix">
<div id="logo">
<a href="<?php echo home_url(); ?>" class="logo_img">
<img src="<?php echo $of_option['st_logo_image'] ?>" alt>
</a>
</div>
<div id="navigation">
<?php wp_nav_menu(array('menu' => 'custom_menu')); ?>
<?php if($of_option['st_responsive']) responsive_select_nav() ?>
</div>
</div>
</div>
答案 0 :(得分:2)
您需要了解如何正确构建HTML布局。我将标题分开并将其放在容器之前,以便它们独立。
#header {background: #eee; height: 50px;}
.container {background: #ccc; width: 200px; margin: auto; height: 200px;}
<div id="header">Header here</div>
<div class="container clearfix">
<div id="logo">
<a href="" class="logo_img">
<img src="" alt="Logo here">
</a>
</div>
<div id="navigation">
PHP stuff here
</div>
</div>