Jump to content
  • 0

Поместить кнопку внутрь блока


Неугомонный
 Share

Question

Как всегда я % 80 смог сделать а дальше не тащу вообще. В общем как сделать чтобы "Кнопка" была внутри фиолетового контейнера  но не помещая ее в <div class=main></div> ?

https://jsfiddle.net/4Lepbdnr/

Edited by Неугомонный
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
14 минут назад, Неугомонный сказал:

но не помещая ее в <div class=main></div>

<div class="wrap">
  <a class="" href="#">Кнопка</a>
  <div class=main></div>
</div>
a {
  color: #321312;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.wrap {
  position: relative;
  height: 100%;
}

.main {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #2D3142;
  transition: transform .7s ease-in-out;
}

 

Link to comment
Share on other sites

  • 0
36 минут назад, AlexZaw сказал:

<div class="wrap">
  <a class="" href="#">Кнопка</a>
  <div class=main></div>
</div>

a {
  color: #321312;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.wrap {
  position: relative;
  height: 100%;
}

.main {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #2D3142;
  transition: transform .7s ease-in-out;
}

 

Как я понимаю widht и height 100% можно заменить на right:0; и bottom:0; , получу тот же эффект в совокупности с top: 0; и left:0?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy