gpt4 book ai didi

html - 如何调整列表样式图像的大小?

转载 作者:太空宇宙 更新时间:2023-11-04 07:35:58 25 4
gpt4 key购买 nike

只是通过重新创建 tumblr 网站来做一些练习,我在显示“推荐的博客”的右侧遇到了一些问题。我想实现使用小用户图标 Logo 而不是列表样式元素符号。是否可以在 css 中调整图像的大小?还是我必须在 photoshop 中调整图像的大小?

看看My Code pen

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 */

最佳答案

#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;
}

请不要介意我的选择器

关于html - 如何调整列表样式图像的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48956680/

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