I even tried changing the background-image to just background but still no joy.
Please help and maybe if someone could maybe explain why this is a problem.
This has nothing to do with PHP... PHP is a server side technology, while CSS is client side. They don't ever interact directly.
So what you're saying is that if you put your input[type="text"] definition first, it works, if you put your input[type="password"] definition first, it works, but neither works when it comes after the other?
What browser are you using/testing on? Can you show an example of the HTML you're testing it on? Any other conflicting definitions later on?
From this information alone, I don't see any issue with your CSS and have insufficient information to find an answer.
Given they have the same attributes, why not make them one definition?
Ok suddenly works but don't know why?
The following still don't work though:
Code:
<!-- onfocus it displays a border and diffirent text color -->
input[type="text"]:focus {
border: 3px solid #ff0000 !important;
color: #000000 !important;
}
input[type="password"]:focus {
border: 3px solid #ff0000 !important;
color: #000000 !important;
}
I have attached all the files, this is still the beginning stages and don't even need to worry about such rills but I tried it and if something should work but does not I want to know why and the persue it to find out why.
Bellow all my coding thus far. (I am not wanting complete code, just explanations and suggestions)
Thanks
Avoid !important... the more you use it, the more habitual it becomes, and the worse your code gets. Avoid it at all costs. Most uses of !important are because you didn't write your CSS properly.
Also, again, what browser are you using?
And yes, .{name of class} is how you definite a class in your CSS, but you also have to give your element a class tag with that name in it.
<!-- Change background colors and text alignment and colors on text and password boxes -->
input[type="text"] {
background-image: url('site_graphics/seamless_green.jpg');
color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
text-align: left;
}
The red part is causing the problems, you need to delete it. That is an HTML comment, CSS comments are like this:
Code:
/* Change background colors and text alignment and colors on text and password boxes */
Quote:
Originally Posted by DanInMa
most likely the browsers you are testing in don't support that type of selector.
Any reason you cannot assign a class to the inputs instead?
Thanks a lot, tested this feature and works on: Google Chrome,Firefox and IE8 and below but not on IE9
Code:
/* Onfocus it displays a border and diffirent text color */
input[type="text"]:focus, input[type="password"]:focus {
border: 2px solid #ff0000;
color: #000000;
}