CSS не отображается на веб-странице

#css

#css

Вопрос:

У меня есть веб-страница, которая использует внешний файл CSS для отображения моих веб-страниц на моем сайте. Все мои страницы в значительной степени соответствуют одному и тому же формату в том, что касается макета, и у меня есть разные разделы в файле Site.css для каждой страницы. По какой-то причине одна веб-страница неправильно отображает CSS. У меня есть div, определенный с идентификатором, и он не распознает идентификатор в div, даже если он определен в файле CSS. Если я использую другой идентификатор, то он отображается в соответствии с CSS этого идентификатора. В частности, цвет фона не устанавливается. Вот снимок экрана сайта с использованием CSS. Как вы можете видеть на этом снимке экрана, <div id="Devotions"> он не подбирает CSS.

Проблема с CSS

Если я изменю идентификатор на ChristianFormaion, страница будет отображаться так, как я хочу, и CSS будет отображаться так, как показано на снимке экрана ниже.

Css нет проблем

В представлении Devotions отображается в раскрывающемся списке, когда я устанавливаю идентификатор для div. Вот код представления:

     @{
    ViewBag.Title = "Devotions";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div id="Devotions">
    <h1 class="devotions_center">DEVOTIONS</h1>
    <div class="devotions_body">
        <p><img src="~/images/Devotions_cross.jpg" alt="Assumption B.V.M." width="53" height="79" align="right" class="padding15" /></p>
        <h2><a name="CharismaticPrayerGroup" id="CharismaticPrayerGroup"></a>Charismatic Prayer Group</h2>
        <p>The Assumption Charismatic Prayer Group has been meeting every Monday evening since 1973 to offer praise, thanksgiving and petitions to our God, Father, Son and Holy Spirit. The purpose of our prayer meeting is to seek a close personal relationship with Jesus and experience the working of the Holy Spirit in our lives in a deeper way. The word “charismatic” refers to the charisms or gifts of the Holy Spirit which we prayerfully seek through praise, both verbally and in song, scripture reading, sharing of answered prayer, prophecy and petition. Some of our members have been involved for over forty years and have experienced many answers to prayer and personal transformation. We meet every Monday evening at 7:15 in the Rectory Meeting Room. If you have any questions, contact Jean Ambs at 215-355-4974.</p>
    </div>
    <div class="devotions_body">
        <h2><a name="Exposition" id="Exposition"></a>Eucharistic Adoration</h2>
        <p>Eucharistic Adoration is held every Tuesday, beginning immediately after the 8:30 a.m. Mass and concluding at 6:45 p.m. with Evening Prayer from “The Liturgy of the Hours” followed by Benediction.  Stop in for a visit any time.  Better still, consider signing up for a holy hour of personal prayer before the Blessed Sacrament.  Bring your needs to the Lord!   For more information contact Deacon Eric at 215-357-1221, ext. 24, or email deaconeric.abvm@gmail.com</p>
    </div>
    <div class="devotions_body">
        <p><img src="~/images/Devotions_bible.jpg" alt="Assumption B.V.M." width="86" height="73" align="left" class="padding15" /></p>
        <h2><a name="FaithSharing" id="FaithSharing"></a>Faith Sharing</h2>
        <p>A Bible/Faith Sharing Group meets on Wednesday mornings after the 8:30 Mass in the Mary Chapel, September through May. We use the “Word Among Us” monthly publication and focus on the Scripture for the following Sunday. Come grow with us in gaining insight into readings for Mass. Everyone is invited to join our informal group. Contact Theresa Poitras at 215-357-3933 or email theresaj38@verizon.net</p>
    </div>
    <div class="devotions_body">
        <h2><img src="~/images/Devotions_rosary.jpg" alt="Assumption B.V.M." width="172" height="89" align="right" /><a name="Rosary" id="Rosary"></a>Rosary</h2>
        <p>Prayed in Church at 8:00 AM before the 8:30 AM daily Mass.</p>
        <h2><a name="PrayerPhoneTree" id="PrayerPhoneTree"></a>Prayer Line</h2>
        <p>A group of parishioners volunteer to pray for the special intentions of our parish. If you have a request that you would like prayers for, please call Ginger Henry at 215-357-3394.</p>
    </div>
    <div class="devotions_body">
        <h2><a name="Miraculous" id="Miraculous"></a>Miraculous Medal Novena</h2>
        <p>Prayed in Church Thursday mornings following the 8:30 AM Mass.</p>
    </div>
    <div class="devotions_body">
        <h2><img src="~/images/Devotions_Mary.jpg" alt="Assumption B.V.M." width="84" height="96" align="right" /><a name="LegionofMary" id="LegionofMary"></a>Legion of Mary</h2>
        <p>The Legion of Mary is a lay Catholic organization founded by the Servant of God, Frank Duff, in Dublin, Ireland on September 7, 1921. Long before the recognition that the laity is vital to the work of the Catholic Church after Vatican Council II, the Legion of Mary, as a lay apostolic association with the approval of the Catholic Church and the intercession of Mary Immaculate, seeks the holiness of its members as they actively invite other people to holiness by doing the works assigned them by their Spiritual Director. In our parish, Our Lady of the Assumption Praesidium, the basic unit of the Legion, meets on Thursdays at 6:45 p.m. in the Mary Chapel, which is to the right of the church vestibule as you enter our church.</p>

        <p>Currently, Father Mike Davis, Spiritual Director, asks the legionaries to visit homebound parishioners, residents of nursing homes and to bring the Pilgrim Virgin Statue to parishioners’ homes as requested. The primary purpose of the Pilgrim Virgin Statue home visitation is to help families to respond to the requests of the Blessed Mother Mary during the 1917 apparitions at Fatima: to return to God, make reparation for sins and to pray the Rosary for Peace. For more information, please contact Elaine Flood at 215-962-4312 or email lainey39forever@yahoo.com</p>
    </div>

</div>
 

Вот CSS в файле Site.css для посвящений:

 /* ========================================================================================*/
/* devotions.aspx */
#Devotions {
    background-color: #dee4fe;
    padding: 5px;
}

.devotions_body {
    padding: 5px 15px 15px 15px;
    margin-left: auto;
    margin-right: auto;
}

.devotions_center {
    text-align: center;
}

.devotions_left {
    text-align: left;
}

.devotions_right {
    text-align: right;
}

.devotions_color {
    color: #005bac;
    color: #006699;
}
 

Вот CSS для христианской информации:

 /* ========================================================================================*/
/* christianformation.aspx */
#ChristianFormation {
    background-color: #dee4fe;
    padding: 5px;
}

.christianformation {
    color: #B4C1E3;
    border-width: 0;
    padding-right: 3px;
    vertical-align: middle;
}

.christianformation_hr {
    margin-bottom: 15px;
    border-top: 1px solid black;
}
 

Приветствуется любая помощь в определении того, почему CSS Devotions не отображается.

Комментарии:

1. На скриншоте без проблем вы можете видеть, что #ChristianFormation на самом деле находится в site.css.

2. Согласен, в этом и заключается проблема. Однако Devotions также находится в site.css. Как отмечено в сообщении. Я пытаюсь выяснить, почему он не распознается при отображении страницы.