
Originally Posted by
ronpat
Just in case clearing the cache doesn't help, try Eric's suggestion and add the !important modifier to your styles like this:
Code:
#boxMessage p {
padding: 0.5em 0 0.5em 0 !important;
}
#boxMessage #indentText {
padding: 0.5em 0 0 2em !important;
display:block !important;
}
If this solves the problem, then eliminate the modifiers one at a time until you determine which property is being overridden; then try to find out where the override is occurring and you should be able to address your selector so it wins the contest.
The !important modifier shouldn't be considered a solution unless there is no other way to overcome the specificity issue.
There is a recent thread that gives some great information about specificity:
http://www.sitepoint.com/forums/show...=1#post5291916
Well, it is a new day, and I tried all of the suggestions above and I am still striking out?!
Here is the *incorrect* output I am seeing...
E-mail Changed
Your e-mail has been changed, and a confirmation e-mail sent to:
username@mail.com
Please log in using the new e-mail. (2128)
And here is the PHP code I am currently using...
PHP Code:
echo '<h1>E-mail Changed</h1>';
echo '<p>Your e-mail has been changed, and a confirmation e-mail sent to:</p>';
echo '<p id="newEmailAddy">' . str2htmlentities($newEmail) . '</p>';
// echo '<p>Your e-mail has been changed, and a confirmation e-mail sent to:';
// echo '<span id="indentText"><b>' . str2htmlentities($newEmail) . '</b></span></p>';
echo '<p>Please log in using the new e-mail. (2128)</p>';
echo '<a class="button" href="' . BASE_URL . '/account/log-in.php">Log In</a>';
Here are my current styles...
Code CSS:
#boxMessage h1{
font-size: 1.2em; /* 2012-05-11 */
margin: 0.5em 0 -0.2em 0; /* 2011-05-11 */
padding: 0; /* 2011-05-11 */
}
#boxMessage p{
padding: 0.5em 0 0.5em 0;
}
#newEmailAddy{
display: block;
padding: 1em 0 1em 2em !important;
}
And here is the actual HTML from my PHP...
HTML Code:
<!-- MIDDLE COLUMN -->
<div id="pageMidCol_1">
<div id="boxMessage">
<h1>E-mail Changed</h1><p>Your e-mail has been changed, and a confirmation e-mail sent to:</p>
<p id="newEmailAddy">username@mail.com</p>
<p>Please log in using the new e-mail. (2128)</p>
<a class="button" href="http://local.debbie/account/log-in.php">Log In</a>
</div>
</div><!-- End of #MIDDLE -->
When I select this code in FireBug...
HTML Code:
<p id="newEmailAddy">username@mail.com</p>
...I see this in the Style window off to the side...
HTML Code:
#boxMessage p {
padding: 0.5em 0;
}
...which is active, and then I see this below it...
HTML Code:
p {
padding: 0 0 1em;
}
...which has a STRIKETHOUGH through it saying that my #boxMessage style is over-riding my default p style.
However, nowhere do I see newEmailAddy?! 
Any ideas what is going on???
Thanks,
Debbie
Bookmarks