我在网络浏览器中得到以下结果:
选中标记相对于文本而言略微升高,但我希望文本全部对齐.我该怎么办?
我有以下HTML:
<?php echo $pageContents->getContents("comptrainLI1"); ?>
- HTML
- CSS
- JavaScript
- jQuery
- PHP
- SQL
- WordPress CMS
- Magento CMS
<?php echo $pageContents->getContents("comptrainLI2"); ?>
- C
- C++
- C#
- Java
和CSS:
div#mainContent ul.train {
list-style-position: inside;
list-style-image: url("../images/checkmark-round-whiteOnGreen.jpg");
font-size: 18pt;
}
div#mainContent ul.train ul.traininner {
padding-left: 20px;
list-style-image: url("../images/checkmark-round-whiteOnGreen.jpg");
}
解决方法:
我认为无法根据您在问题中发布的受限代码来了解未对齐的原因.这可能是您的PHP中的东西.因此,我发布了一个通用解决方案.
li {
list-style-type: none;
margin-bottom: 5px;
}
ul.traininner li::before {
content: '';
display: inline-block;
vertical-align: bottom;
padding: 10px 20px 0 0;
height: 10px;
width: 10px;
background-image: url("http://i.imgur.com/F05JSPD.png");
background-repeat: no-repeat;
}
-
- HTML
- CSS
- JavaScript
- jQuery
- PHP
- SQL
- WordPress CMS
- Magento CMS
-
- C
- C++
- C#
- Java
标签:image,html-lists,css,html,php
来源: https://codeday.me/bug/20191119/2038464.html