根据HTML GetUiKit文档,此html代码应创建3个漂亮的按钮,并在文本周围带有一个矩形。但是此代码仅显示按钮的文本,而不显示矩形。 https://getuikit.com/v2/docs/button.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.1.7/css/uikit.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.1.7/js/uikit.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.1.7/js/uikit-icons.min.js"></script>
</head>
<body>
<a class="uk-button" href="">Link</a>
<button class="uk-button" type="button">Button</button>
<button class="uk-button" type="button" disabled>Disabled</button>
</body>
</html>
如何解决这个问题?
答案 0 :(得分:0)
您指的是旧的文档,自v2以来,很多事情已更改。看看当前的UIKit v3(因为您在代码段中使用了v3,并且在上一个问题中也使用了它)
https://getuikit.com/docs/button
下面您可以看到正确使用的类。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.1.7/css/uikit.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.1.7/js/uikit.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.1.7/js/uikit-icons.min.js"></script>
</head>
<body>
<a class="uk-button uk-button-default" href="">Link</a>
<button class="uk-button uk-button-primary" type="button">Button</button>
<button class="uk-button uk-button-default" type="button" disabled>Disabled</button>
</body>
</html>