Строки или столбцы plxels в <li>элементах пропускают цвет - PullRequest
0 голосов
/ 30 ноября 2018

У меня есть несколько квадратных <li> элементов, содержащих тексты.Все они имеют одинаковый цвет.

Проблема, с которой я сталкиваюсь, заключается в том, что после того, как я наложил тень на элементы <li>, я вижу, что на границе этих элементов отсутствует серия пикселей.цвет, который наносится на них.Это показано на следующем рисунке -

pixels are not having color

Код -

HTML:

<!DOCTYPE html>
<html>
<head>
    <title>Details of university project</title>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>

    <div class="container">

        <div class="header">
            <h1>University Management</h1>
        </div>

        <div class="project-features">
            <h2>Project features</h2>
            <ul>
                <li><span>Flat UI </span></li>
                <li><span>Responsive </span></li>
                <li><span>PDF and Excel conversion </span></li>
                <li><span>Live Search </span></li>
            </ul>
            <ul>
                <li><span>Flat UI </span></li>
                <li><span>Responsive </span></li>
                <li><span>PDF and Excel conversion </span></li>
                <li><span>Live Search </span></li>
            </ul>
        </div>

    </div>

</body>
</html>

CSS:

.project-features {
    min-width: 300px;
    margin: 0 auto;
    display: block;
    text-align: center;
}

.project-features h2 {
    display: block;
    margin: 0;
    padding: 70px 0 50px 0;
    font-size: 150%;
    text-transform: uppercase;
}

.project-features ul {
    display: inline-block;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 80%;
    font-size: 0; /* For removing html whitespaces on inline-block elements */
}

.project-features ul:last-child {
    margin-top: 20px;
}

.project-features ul li {
    display: inline-block;
    position: relative;
    box-shadow: 0 0 10px 2px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #2980b9, #16a085);
    width: 22%;
    font-size: 18px; /* For removing html whitespaces on inline-block elements */
}

.project-features ul li:not(:first-child) {
    margin-left: 4%;
}

/* For making the box a square */
.project-features ul li:after {
    content: "";
    display: block;
    padding-top: 100%;
}

/* Text inside the box */
.project-features ul li span {
    position: absolute;
    display: block;
    width: 100%;
    text-align: center;
    color: #fff;
    top: 50%;
    transform: translate(0,-50%);
}

Смотрите полную реализацию в Github, если вам это нужно:

https://shourovfoisal.github.io/University-Project/

Любая помощь будет оценена.

...