我想在图像下对齐一些文本,但图标在左侧。每当我在其上放置一个 padding-left 或 right 或 margin 时,它都会以一个块为中心,但不能同时为两个块居中。这真的很烦人。您可以在此屏幕截图中看到它:http: //cl.ly/1G0D191t1G3V1v0a0K2q
HTML:
<html xmlns="http://www.w3.org/1999/html">
<head>
<link href="<?php echo base_url('css/style.css');?>" rel="stylesheet" type="text/css" />
<title>Admin :: Home</title>
</head>
<body>
<div id="wrapper">
<div class="admin-form">
<div class="header">
<h1>Admin Home</h1>
</div>
<div class="content dashboard clearfix">
<ul>
<li><a href='<?php echo base_url('admin/DiveLocations');?>'><img src='<?php echo base_url('images/icons/duikplaats.png');?>'/>Duiklocaties</a></li>
<li><a href='<?php echo base_url('admin/DiveEvents');?>'><img src='<?php echo base_url('images/icons/scubadiving.png');?>'/>Duiken</a></li>
<li><a href='<?php echo base_url('admin/Users');?>'><img src='<?php echo base_url('images/icons/users.png');?>'/>Gebruikers</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
CSS:
.dashboard img {
display: block;
margin-left:25px;
}
.dashboard ul li {
list-style-type: none;
float: left;
padding: 0 10px 0 0;
}