Let li tag of a tag content covered li

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/qq_40053398/article/details/88679723

html part

<ul id="list">
	<li class="select" style="text-align:center;"><a href="ArticleAction_toCompany.action?toPage=companyProfile">公司简介</a></li>
	<li style="text-align:center;"><a href="ArticleAction_toCompany.action?toPage=cultureIdea">企业文化</a></li>
	<li style="text-align:center;"><a href="/hr/html/company/honoraryQualification.html">资质荣誉</a></li>
	<li style="text-align:center;"><a href="ArticleAction_toCompany.action?toPage=organization">组织机构</a></li>
	<li style="text-align:center;"><a href="ArticleAction_toCompany.action?toPage=connect">联系我们</a></li>
</ul>

The original results page

Here Insert Picture Description
Mouse must be placed on the label text in order to trigger a click action

Add a tag attribute

display: flex;
display: block;
justify-content: center;
align-items: center;

Add property label where li

height: 44px;
line-height: 44px;

After the addition, any place as long as the tag is located in a li can trigger clicks a label.

Guess you like

Origin blog.csdn.net/qq_40053398/article/details/88679723