gpt4 book ai didi

html - 平行四边形形式的导航面板链接 - 需要纯文本

转载 作者:行者123 更新时间:2023-11-28 05:52:53 29 4
gpt4 key购买 nike

我正在处理导航面板。我在链接上使用了 skewX,但它也扭曲了文本。是否可以像垂直一样使文本笔直。我试着做 <a href.....><p>Assassin's Creed</p></a>然后扭曲文本但它破坏了显示,

ul {
list-style-type: none;
background-color: rgb(0,0,0);
margin: 0;
padding: 0;
overflow: hidden;
}
li {
float: left;
}
li a {
margin: 15px;
background-color: red;
display:block;
border: 2px solid white;
padding: 12px;
text-decoration: none;
color: white;
cursor: pointer;
transform: skewX(30deg);
transition: box-shadow 0.2s, background-color 0.2s;
}
li a:hover {
box-shadow: 10px 0px 1px cyan, -10px 0px 1px cyan ;
background-color: black;
}
div a img:hover {
opacity: 1.0;
width: 290px;
margin: 5px 0 0 0;
box-shadow: 0px 0px 15px blue;
}
<!DOCTYPE html>
<html>
<head>
<title>Gallery</title>
<link rel="stylesheet" href="styles/styleweb.css">
</head>
<body>
<ul>
<li><a href="som.html"><b>Shadow of Mordor</b></a></li>
<li><a href="tr.html"><b>Tomb Raider</b></a></li>
<li><a href="ac.html"><b>Assassin's Creed</b></a></li>
<li><a href="bf4.html"><b>Battlefield 4</b></a></li>
</ul>
</body>
</html>

最佳答案

将文本向后倾斜:

li a b {
transform: skewX(-30deg);
display:inline-block;
}

注意:tranform 不会自动在内联元素上工作,例如 span 标签或 b 标签...因此我们必须将 display:property 设置为更合适的内容...在本例中为 inline-block

ul {
list-style-type: none;
background-color: rgb(0, 0, 0);
margin: 0;
padding: 0;
overflow: hidden;
}
li {
float: left;
}
li a {
margin: 15px;
background-color: red;
display: block;
border: 2px solid white;
padding: 12px;
text-decoration: none;
color: white;
cursor: pointer;
transform: skewX(30deg);
transition: box-shadow 0.2s, background-color 0.2s;
}
li a b {
transform: skewX(-30deg);
display: inline-block;
}
li a:hover {
box-shadow: 10px 0px 1px cyan, -10px 0px 1px cyan;
background-color: black;
}
div a img:hover {
opacity: 1.0;
width: 290px;
margin: 5px 0 0 0;
box-shadow: 0px 0px 15px blue;
}
<!DOCTYPE html>
<html>

<head>
<title>Gallery</title>
<link rel="stylesheet" href="styles/styleweb.css">
</head>

<body>
<ul>
<li><a href="som.html"><b>Shadow of Mordor</b></a>
</li>
<li><a href="tr.html"><b>Tomb Raider</b></a>
</li>
<li><a href="ac.html"><b>Assassin's Creed</b></a>
</li>
<li><a href="bf4.html"><b>Battlefield 4</b></a>
</li>
</ul>
</body>

</html>

最后一点..b 标签在这里可能不合适...您应该改用样式化的 span 标签。

Historically, the element was meant to make text boldface. Styling information has been deprecated since HTML4, so the meaning of the element has been changed.

If there is no semantic purpose on using the element, using css property font-weight with bold value would be a better choice for making text bold.

关于html - 平行四边形形式的导航面板链接 - 需要纯文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37228822/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com