css arrow box html,css shapes - Arrow Box with CSS - Stack Overflow

SVG is the recommended way to create such shapes. It offers simplicity and scale-ability.

We can use SVG's polygon or path element to create a shape like above and stroke / fill it with some solid color, gradient or a pattern.

Only one attribute points is used to define shapes in polygon element. This attribute consists of a list of points. Each point must have 2 numbers, an x coordinate and a y coordinate. A straight line is drawn automatically from the last point to the starting point to close the shape.

Below is the necessary code to create this shape:

stroke="#333"

stroke-width="2"

fill="#eee" />

Below is a brief description of the above code:

points attribute defines the structure of the shape.

stroke attribute defines the color for the outline / border.

stroke-width defines the thickness of the outline / border.

fill attribute defines the color for the interior shape to be filled.

Output Image:

4KoSK.png

Working Example:

body {

background: #b6cdc7 url("https://www.hdwallpapers.net/previews/hot-air-balloon-over-the-mountain-987.jpg") no-repeat;

background-position: center bottom;

background-size: cover;

margin: 0;

}

.box {

justify-content: center;

align-items: center;

height: 100vh;

display: flex;

}

This shape can be filled with gradient or pattern as well.

B0ubZ.png

Working Example:

body {

background: #b6cdc7 url("https://www.hdwallpapers.net/previews/hot-air-balloon-over-the-mountain-987.jpg") no-repeat;

background-position: center bottom;

background-size: cover;

margin: 0;

}

.box {

justify-content: center;

align-items: center;

height: 100vh;

display: flex;

}

We can apply shadow on this shape using SVG's filters.

4HzDL.png

Working Example:

body {

background: #b6cdc7 url("https://www.hdwallpapers.net/previews/hot-air-balloon-over-the-mountain-987.jpg") no-repeat;

background-position: center bottom;

background-size: cover;

margin: 0;

}

.box {

justify-content: center;

align-items: center;

height: 100vh;

display: flex;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值