当前位置:网站首页>How to use div boxes to simulate line triangles
How to use div boxes to simulate line triangles
2022-06-30 04:17:00 【Chang Li Lin】
One 、 Analysis method : Use boxes to simulate line triangles
Three boxes . One to limit the line position , The other two are divided into upper and lower structures , By means of rotation , Fine tuning top,left value , You can make line triangles .
Two 、 Add three boxes
External box em, Inner box i,b.em The box class The value of the property is arrow.
Source code :
<ul>
<li>
<a href=""> Destination </a>
</li>
<li>
<a href=""> kits </a>
</li>
<li class="have-menu">
<a href=""> Community </a>
<em class="arrow">
<b></b>
<i></i>
</em>
</li>
<li>
<a href=""> Travel Assistant </a>
</li>
<li class="have-menu">
<a href=""> Shopping Mall </a>
<em class="arrow">
<b></b>
<i></i>
</em>
</li>
<li class="have-menu">
<a href=""> The hotel · Home stay </a>
<em class="arrow">
<b></b>
<i></i>
</em>
</li>
<li>
<a href=""> Special rate hotel </a>
</li>
</ul>
3、 ... and 、 Set the absolute positioning and other elements for the three boxes
By setting the relative positioning of the three box parent boxes , Set absolute positioning and different colors for the three boxes , Three boxes can be stacked . External box em At the bottom , Two i,b The box is on the same floor .
Source code :
.site-head .topbar .shortcut-links>ul>li.have-menu{
padding-right: 12px;
position: relative;
}
.site-head .topbar .shortcut-links>ul>li.have-menu .arrow{
height:12px;
width:12px;
position:absolute;
top:50%;
margin-top: -6px;
background-color: orange;
}
.site-head .topbar .shortcut-links>ul>li.have-menu .arrow b{
position: absolute;
height:6px;
width:6px;
background-color:red;
}
.site-head .topbar .shortcut-links>ul>li.have-menu .arrow i{
position: absolute;
height:6px;
width:6px;
background-color:rebeccapurple;
}
design sketch :![]()
Four 、 rotate , Change the background color , Micromodule box left and top value .
We will find that the inner two boxes are not in the middle of the outer box , It would be ugly , So first fine tune left,top It's worth keeping him at the parent level arrow Right in the middle of the box . This is still wrong , Because if you move the other box up , It forms purple or red rectangular lines .
therefore i,b The box needs to be rotated 45°, To reach the sharp corner of the square down . Delete the background color of the parent box , The sub boxes are body Background color and white , You can simulate a line triangle .
All of the code :
.site-head .topbar .shortcut-links>ul>li.have-menu{
padding-right: 12px;
position: relative;
}
.site-head .topbar .shortcut-links>ul>li.have-menu .arrow{
height:12px;
width:12px;
position:absolute;
top:50%;
margin-top: -6px;
}
.site-head .topbar .shortcut-links>ul>li.have-menu .arrow b{
position: absolute;
height:6px;
width:6px;
background-color:white;
left:3px;
top:2.5px;
transform: rotate(45deg);
}
.site-head .topbar .shortcut-links>ul>li.have-menu .arrow i{
position: absolute;
height:6px;
width:6px;
background-color:#383D42;
top:1px;
left:3px;
transform: rotate(45deg);
} design sketch :![]()
Of course , We can also join 3d Special effects , Let the line triangle rotate , Zoom, etc , Make the page more beautiful , More experience .
边栏推荐
- [Thesis reading | deep reading] role2vec:role based graph embeddings
- Myrpc version 5
- Find the interface and add parameters to the form
- How to solve the problem of link hyperlinks when trying to link the database?
- Introduction to cloud native + container concept
- 网络层详解
- Qt 6.3.1Conan软件包发布
- Detailed explanation of data link layer
- SQL server2005中SUM函数中条件筛选(IF)语法报错
- Titanic(POJ2361)
猜你喜欢

(04). Net Maui actual MVVM

Es2017 key summary

El upload Upload file (Manual upload, Automatic upload, upload progress)

SQLyog导入数据库时报错,求帮解决!

How the FortiGate firewall rejects a port by using the local in policy policy
![[cloud native] AI cloud development platform - Introduction to AI model foundry (developers can experience AI training model for free)](/img/08/b390810d457af5e4470d9743b01ca1.png)
[cloud native] AI cloud development platform - Introduction to AI model foundry (developers can experience AI training model for free)

With the deep integration of cloud platform, the "Xueba" objectscale in the object storage industry is coming

Robot slam navigation core technology and practice Season 1: Chapter 0_ Slam development overview

FortiGate firewall configuration log uploading regularly

The school training needs to make a registration page. It needs to open the database and save the contents entered on the registration page into the database
随机推荐
深度融合云平台,对象存储界的“学霸”ObjectScale来了
网络层详解
JS import and export
oslo_ config. cfg. ConfigFileParseError: Failed to parse /etc/glance/glance-api. Conf: a solution to errors
Idea grey screen problem
Error Nova missingauthplugin: an auth plugin is required to determine endpoint URL
FortiGate firewall modifies the default timeout of a session
Configure specific source IP in SLA detection of FortiGate sdwan
JS deconstruction assignment
Splicing strings with custom functions
lego_ Reading and summary of loam code
When easycvr deploys a server cluster, what is the reason why one is online and the other is offline?
Myrpc version 4
Machine learning notes
mysql更新数组形式的json串
FortiGate firewall filters the specified session and cleans it up
Titanic(POJ2361)
Cloud native -- websocket of Web real-time communication technology
(04). Net Maui actual MVVM
基于海康EhomeDemo工具排查公网部署出现的视频播放异常问题