只是通过重新创建tumblr网站做一些练习,我在右侧有一些问题,其中有“推荐博客”。我想实现使用小用户图标徽标而不是列表样式项目符号。是否可以调整css中的图像大小?或者我是否必须在photoshop中调整图像大小?
HTML
<html>
<head>
<title>Tumblr</title>
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<link rel="stylesheet" type="text/css" href="tumblrstyle.css">
</head>
<body>
<!-- Header Navigation -->
<div class="top-head">
<header>
<div id="top-head-left">
<h1>T</h1>
<input type="text" name="" placeholder="">
<i class="fas fa-search"></i>
</div>
<div id="top-head-right">
<a href="#"><i class="fas fa-home fa-2x"></i></a>
<a href="#"><i class="far fa-compass fa-2x"></i></a>
<a href="#"><i class="fas fa-envelope fa-2x"></i></a>
<a href="#"><i class="far fa-comment fa-2x"></i></a>
<a href="#"><i class="fas fa-bolt fa-2x"></i></a>
<a href="#"><i class="fas fa-user fa-2x"></i></a>
</div>
</header>
</div>
<!-- End Header -->
<!-- RightBar -->
<div class="container">
<div class="right-side">
<div class="right-side nav">
<h3>Recommended Blogs</h3>
<ul id="navi">
<li>empty</li>
<li>empty</li>
<li>empty</li>
<li>empty</li>
</ul>
</div>
<div class="radar">
<h3>radar</h3>
<ul>
<li>empty</li>
<p>
</p>
</ul>
</div>
</div>
<!-- Post Controls -->
<div class="controller">
<a href="#"><img src="https://image.freepik.com/free-vector/abstract-summer-sun-logo- design_1436-184.jpg"></a>
<div class="post-group">
<div class="icons">
<a href="#"><i class="fas fa-home fa-5x"></i></a>
</div>
<div class="icons">
<a href="#"><i class="far fa-compass fa-5x"></i></a>
</div>
<div class="icons">
<a href="#"><i class="fas fa-envelope fa-5x"></i></a>
</div>
<div class="icons">
<a href="#"><i class="far fa-comment fa-5x"></i></a>
</div>
<div class="icons">
<a href="#"><i class="fas fa-bolt fa-5x"></i></a>
</div>
<div class="icons">
<a href="#"><i class="fas fa-user fa-5x"></i></a>
</div>
</div>
</div>
</body>
</html>
CSS
/*Reset*/
* {
margin: 0;
padding: 0;
}
body {
background: lightgray;
}
header {
padding: 0 10px;
}
header h1 {
display: inline;
margin-right: 15px;
}
.container {
width: 60%;
margin: auto;
overflow: visible;
}
div h3 {
border-bottom: 1px solid black;
}
/*Header*/
.top-head {
background: lightblue;
height: 60px;
border-bottom: 5px solid black;
padding: 0px 20px;
}
#top-head-left {
float: left;
padding-top: 5px;
}
#top-head-left input[type="text"] {
width: 200px;
background: yellow;
padding: 5px 0px;
}
#top-head-right {
float: right;
padding-top: 12px;
}
/*RightsideBar*/
.right-side {
float: right;
}
.nav ul {
list-style-image: url('https://78.media.tumblr.com/avatar_0f16d6a6a019_128.pnj');
}
.nav ul li {
}
.radar ul {
list-style: none;
}
/*Post Controller*/
.controller {
margin-top: 50px;
}
.controller img {
width: 10%;
float: left;
margin-right: 20px;
border-radius: 10px;
}
.post-group {
float: left;
background: white;
height: 68px;
border-radius: 10px;
padding-top: 8px;
padding-bottom: 22px;
}
.icons {
float: left;
}
.icons a {
color: orange;
padding: 0 12px;
}
/* https://78.media.tumblr.com/avatar_3aed9115be2f_128.pnj
https://78.media.tumblr.com/avatar_0f16d6a6a019_128.pnj
https://78.media.tumblr.com/avatar_0f16d6a6a019_128.pnj
https://78.media.tumblr.com/avatar_996dede0302e_128.pnj */
答案 0 :(得分:0)
#navi {
list-style-type: none;
}
#navi > li::before {
content: '';
display: inline-block;
height: 40px;
width: 40px;
background-size: 40px;
background-image: url('https://78.media.tumblr.com/avatar_0f16d6a6a019_128.pnj');
background-repeat: no-repeat;
margin-right: 10px;
background-position: center center;
vertical-align: middle;
}
请不要介意我的选择