搜索图标未显示在HTML&;中;CSS(Adobe Dreamweaver CC 2019)
我一直在做一个小作业,似乎无法让搜索图标出现在搜索栏中。我到处寻找答案,这真的让我很烦哈哈。我会说我是HTML和css的初学者,所以如果有任何愚蠢的错误,请务必理解搜索图标未显示在HTML&;中;CSS(Adobe Dreamweaver CC 2019),html,css,icons,font-awesome,Html,Css,Icons,Font Awesome,我一直在做一个小作业,似乎无法让搜索图标出现在搜索栏中。我到处寻找答案,这真的让我很烦哈哈。我会说我是HTML和css的初学者,所以如果有任何愚蠢的错误,请务必理解 <!doctype html> <html> <head> <meta charset="utf-8"> <style> .searchbar {display: inline-block; float: right;
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
.searchbar {display: inline-block;
float: right;
padding: 20px 0px}
.searchbar input[type=text] {border:none;
font-family: courier;
font-size: 18px;
font-style: italic;
}
.searchbar button {float: right;
padding:12px;
background: #ddd;
font-size: 12px;
border: none;
cursor: pointer;
}
</style>
<title>Untitled Document</title>
</head>
<body>
<div class="searchbar">
<input type="text" placeholder="search...">
<button type="submit"><i class="fa fa-search"></i></button>
</div>
</body>
</html>
.searchbar{显示:内联块;
浮动:对;
填充:20px 0px}
.searchbar输入[type=text]{边框:无;
字体系列:信使;
字号:18px;
字体:斜体;
}
.搜索栏按钮{浮动:右侧;
填充:12px;
背景:ddd;
字体大小:12px;
边界:无;
光标:指针;
}
无标题文件
您正在尝试使用图标。Font Awesome是一个通过CSS提供的图标字体库。因此,为了使.fa
和.fa search
CSS类正常工作,您需要在页面上包含字体Awesome CSS
.searchbar{
显示:内联块;
浮动:对;
填充:20px 0px
}
.searchbar输入[类型=文本]{
边界:无;
字体系列:信使;
字号:18px;
字体:斜体;
}
.搜索栏按钮{
浮动:对;
填充:12px;
背景:ddd;
字体大小:12px;
边界:无;
光标:指针;
}
你需要把FontAwesome包括进去。啊,糟了,我刚刚编辑了他的片段,把它包括进去。嘿@user10803421如果这回答了你的问题,我错误地编辑了你的问题,应该将其还原。PS,欢迎来到SO:)10-4,谢谢。我想他是在问他的花车等问题,我应该多加注意。干杯