Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Html + Css - нужна помощь в правке кода кнопки...


Recommended Posts

Posted (edited)

Всем доброго дня. Сайт на ocStore 2.3

Нужно нное количество кнопок в ряд - над категориями, такой себе своеобразный пользовательский фильтр)). Но надо чтобы они шли именно в ряд скажем если их 6 кнопок, а если более то тогда перенос на следующий ряд. Кнопки я реализовал следующим кодом, с помощью модуля HTML

 

<h2 data-placeholder="Перевод" dir="ltr" id="tw-target-text" style="text-align: center;"><strong style="color: inherit; font-family: inherit;"><a class="btn main1-btn" href="ссілка/ссілка/">07</a></strong><br></h2><h2 data-placeholder="Перевод" dir="ltr" id="tw-target-text" style="text-align: center;"><strong style="color: inherit; font-family: inherit;"><a class="btn main1-btn" href="ссілка/ссілка/">09</a></strong><br></h2><h2 data-placeholder="Перевод" dir="ltr" id="tw-target-text" style="text-align: center;"><strong style="color: inherit; font-family: inherit;"><a class="btn main1-btn" href="ссілка/ссілка/">12</a></strong><br></h2><h2 data-placeholder="Перевод" dir="ltr" id="tw-target-text" style="text-align: center;"><strong style="color: inherit; font-family: inherit;"><a class="btn main1-btn" href="ссілка/ссілка/">18</a></strong><br></h2><h2 data-placeholder="Перевод" dir="ltr" id="tw-target-text" style="text-align: center;"><strong style="color: inherit; font-family: inherit;"><a class="btn main1-btn" href="ссілка/ссілка/">24</a></strong><br></h2><h2 data-placeholder="Перевод" dir="ltr" id="tw-target-text" style="text-align: center;"><strong style="color: inherit; font-family: inherit;"><a class="btn main1-btn" href="ссілка/ссілка/">36</a></strong><br></h2>

 

Код кнопки в файле: stylesheet.css

 

.main1-btn {
	background: #9ea3a5;
	color: #fff;
	font-size: 18px;
	border-color: #818587;
	padding: 10px 30px;
	font-weight: 600;
}

 

Что я получил из этого.  В десктопной версии они в столбик, в мобильной также. 

 

Как сейчас: Ссылка

Увидеть можно тут.

 

А мне надо именно в ряд. И в Десктопной и в мобильной. В ряд и расположение от центра страницы.

Edited by wwizard
Link to comment
Share on other sites


Мм. А конкретная помощь мне бы не помешала((

Link to comment
Share on other sites


html

Скрытый текст

<div class="flex-container">
  <div class="flex-item">1</div>
  <div class="flex-item">2</div>
  <div class="flex-item">3</div>
  <div class="flex-item">4</div>
  <div class="flex-item">5</div>
  <div class="flex-item">6</div>
</div>

css

Скрытый текст

.flex-container {
  display: flex;
  flex-wrap: wrap;
}

.flex-item {
  background: #ccc;
  padding: 5px;
  width: 50px;
  height: 50px;
  margin: 10px;
  line-height: 50px;
  color: #222;
  font-weight: bold;
  font-size: 2em;
  text-align: center;
}

 

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.