Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
At the bellow I have paste the source code that I have been developing but still I cannot get the correct output form both Mozilla Firefox & IE with newest versions.

I also I have validate this using W3C validation service that had not given error on that! If you are able to have small time please try to solve this!

Thanks
Chiranthaka

XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title><!-- Insert your title here --></title>
    
    <style type="text/css">
        
    input.red { background-color: blue }
    inpute [type="text] {background-color: red}
    
    </style>
    
</head>
<body>
    <!-- Insert your content here -->
    <form action="my.php" method="post">
        
        Name: <input class="red" type="text" /> <br/>
        Address: <input type="text" />
        
        
    </form>
</body>
</html>
Posted
Updated 8-Aug-12 21:54pm
v2
Comments
Abdul Quader Mamun 9-Aug-12 3:52am    
Is this required only like you have coded in Style Tag?

1 solution

Hi,

you can do with CSS class like,

XML
<style type="text/css">
.textbox { background-color:#00BFFF; }
</style>

<input type="text" class="textbox" id="your_id" title="YourTitle" />


Hope this way will help you,

Thanks
-Amit Gajjar
 
Share this answer
 
Comments
Chiranthaka Sampath 9-Aug-12 4:11am    
Can't I do this as the following

<pre>
<style type="text/css"
input [type="text] {background-color: red}

</pre>

<body>

Address: <input type="text" />

</body>
AmitGajjar 9-Aug-12 4:20am    
input[type="text"]
{
background-color:yellow;
}

you missed quotation mark after type="text(" is missing)
Abdul Quader Mamun 9-Aug-12 18:25pm    
good work!
AmitGajjar 9-Aug-12 23:18pm    
Thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900