Creating a field using css arrow using css3

.box {
  position: relative;
  margin: 18px;
  width: 8em;
  height: 6em;
  border: 1px solid rgb(77, 77, 77);
  color: #FF1919;
  background-color: pink;
}
.box:hover {
  width: 8em;
  margin: 18px;
}
.box:before {
  content: '';
  position: relative;
  width: 30%;
  left: 18px;
  right: 80%;
  height: 40px;
  top: 30%;
  background: rgba(0, 0, 0, 0.1);
  display: inline-block;
  background-color: blue;
}
.box:after {
  content: '';
  position: absolute;
  left: 43%;
  top: 30%;
  margin-top: -18px;
  border-style: solid;
  border-width: 40px;
  border-color: transparent transparent transparent rgba(0, 0, 0, 0.1);
}
<div class="box"></div>
Run codeHide result

I created one arrow and in it I want to highlight an arrow with a blue color that is gray.

I also want to use this generic button arrow to go to the next page with the html extension.

For this, I use:

<div style="position: absolute; right: 40px; bottom: 70px;">
    <form action="abc.html" align="right" style="margin-right:100px ;   display:inline">
        <input type="submit" class="box"></input>
    </form>
</div>

but it takes one part of this css object field (rectangle) and leaves the other parts.

+4
source share
4 answers

For navigation, you can add a tag <a>on the html page and the class .box:aftercolor change the border color, as shown below:

HTML:

<a href="http://www.w3schools.com" target="_blank"><div class="box"></div></a>

CSS

 .box:after {
      content: '';
      position: absolute;
      left: 43%;
      top: 30%;
      margin-top: -18px;
      border-style: solid;
      border-width: 40px;
      border-color: transparent transparent transparent **rgba(7, 17, 241, 1);**    }

Fiddle

0
source

, HTML, ➧ &#10151; , , .. , .

:

<div class="box">&#10151;</div> div

. ,

<div style="position: absolute; right: 40px; bottom: 70px;">
<form action="abc.html" align="right" style="margin-right:100px ;   display:inline">
    <input type="button" class="box" value="&#10151;"></input>
</form>

CSS

.box {
width:100px;
height:100px;
background-color:pink;
color:blue;
text-align:center;
font-size:100px;
line-height:100px;

}

+1

You can just use pseudo elements.

.arrow {
  height: 50px;
  width: 50px;
  background: #0000ff;
  margin: 20px;
  position: relative;
}
.arrow:after {
  content: '';
  position: absolute;
  top: -15px;
  right: -80px;
  width: 0;
  height: 0;
  border-top: 40px solid transparent;
  border-left: 80px solid #0000ff;
  border-bottom: 40px solid transparent;
}
.box {
  width: 165px;
  padding: 20px;
  border: 1px solid #222;
  background: #eee;
}
<a href="abc.html">
  <div class="box">
    <div class="arrow"></div>
  </div>
</a>
Run codeHide result
+1
source

You just need to change the property for the pseudo element :afterrepresenting the head

 border-color: transparent transparent transparent rgba(0, 0, 255, 1);

.box {
  position: relative;
  margin: 18px;
  width: 8em;
  height: 6em;
  border: 1px solid rgb(77, 77, 77);
  color: #FF1919;
  background-color: pink;
  position: relative;
}
.box:before {
  content: '';
  position: absolute;
  width: 30%;
  left: 20%;
  height: 40px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.1);
  background-color: blue;
}
.box:after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 50%;
  /* before width 30% + before left position 20% */
  border-style: solid;
  border-width: 40px;
  border-color: transparent transparent transparent rgba(0, 0, 255, 1);
}
<div class="box"></div>
Run codeHide result
+1
source

All Articles