Как разместить заголовок перед изображением - PullRequest
0 голосов
/ 25 мая 2020

Как я могу разместить заголовок перед этой фиолетовой фигурой? На изображении показано, как я хочу это сделать.

enter image description here

вот как я позиционирую

.shapeOne {
    display: flex;
    flex-direction: row;
    flex-direction: row-reverse;
    margin-top: -46px;
}

header#main-header {
    margin: 45px 196px 0 121px;
}

Я могу использовать отрицательная маржа вроде этого

 header#main-header {
        margin: ***-240px*** 196px 0 121px;
    }

но я не хочу этого делать, как лучше всего это сделать? Есть ли способ «игнорировать» эту фигуру и поместить перед ней заголовок? Я пробовал все, например свойство позиции, z-index, ничего не получилось.

здесь 'код

<style>

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    z-index: 999;
}
.shapeOne {
    display: flex;
    flex-direction: row;
    flex-direction: row-reverse;
    margin-top: -46px;
}

header#main-header {
    margin: 40px 105px 0 142px;
}

header#main-header .content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

header#main-header nav ul {
    display: flex;
    list-style: none;
}

header#main-header nav ul li {
    display: flex;
    align-items: center;
    font-family: Inter;
    font-style: normal;
    font-weight: normal;
    font-size: 12px;
    line-height: 15px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #363636;
    margin-right: 59px;
}

header#main-header nav ul li:first-child {
    margin: 0;
}

header#main-header nav ul li img {
    margin-right: 71px;
    width: 192px;
}

header#main-header div.side {
    display: flex;
}

header#main-header div.side img {
    height: 34px;
    width: 34px;
    border-radius: 50%;
    margin: 0 15px;
}

header#main-header div.side>a button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 131px;
    height: 48px;
    left: 0px;
    top: 0px;
    background: #FF6B7D;
    box-shadow: 0px 4px 10px rgba(255, 107, 125, 0.4);
    border-radius: 50px;
    border: 0;
    font-family: Inter;
    font-style: normal;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #FFFFFF;
}


</style>
<!DOCTYPE html>
<html>




<body>
    <div class="shapeOne">
        <img src="http://127.0.0.1:5500/images/Vector%205.png" alt="forma 1">
    </div>

    <header id="main-header">
        <div class="content">
            <nav>
                <ul>
                    <li><a href="#"><img src="images/getmore-logo-1.png" ></a></li>
                    <li><a href="about.html" class="about-link">link</a></li>
                    <li><a href="https://comb.com.br/" class="app-link" target="_blank">link</a></li>
                </ul>
            </nav>
            <div class="side">
                <a href="contact.html" style="text-decoration: none; color: #fff"><button>contact</button></a>
            </div>
        </div>
    </header>

   
</body>



</html>

1 Ответ

0 голосов
/ 25 мая 2020

если форма такая, как показано на рисунке, вы пытались присвоить ей свойство абсолютного положения?
Например:

.shapeOne {
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
}

*{
  z-index: 999; /*and if you've noticed all the items, you've given them this. Why?*/
 }

Если это не работает, покажите мне, что это похоже с кодами, которые вы пробовали. Потому что сложно понять, не зная, как это выглядит.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...