Answer the question
In order to leave comments, you need to log in
How to make a submenu the entire width of the container?
Good afternoon. Can you please tell me how to make a horizontal submenu the entire width of the container?
Tried to solve this problem with
.dropdown-menu {
width: 100%;
max-width: 1140px;
text-align: center;
left: 0%;
right: 0%;
top: auto;
position: fixed;
margin: 0 auto;
}
<div class="dropdown-menu">
<div class="dropdown-inner">
<?php foreach (array_chunk($category['children'], ceil(count($category['children']) / $category['column'])) as $children) { ?>
<ul class="list-unstyled">
<?php foreach ($children as $child) { ?>
<li class="drop-dva"><a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a></li>
<?php } ?>
</ul>
<?php } ?>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
First things first: left: 0% overlaps right: 0%, a redundant property.
Second, an example:
<!-- Условный родительский контейнер .container -->
<div class="container">
<!-- Список с элементами меню ul -->
<ul>
<li>
<a href="#">Ссылка 1</a>
</li>
<li>
<a href="#">Ссылка 2</a>
</li>
<li>
<a href="#">Ссылка 3</a>
</li>
</ul>
</div>
<style>
.container ul {
display: block;
height: 60px;
line-height: 60px;
background: #ededed;
}
.container ul li {
display: inline-block;
list-style-type: none;
padding: 0 20px;
}
</style>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question