Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: CSS XHTML
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 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 8-Aug-12 22:46pm
Edited 8-Aug-12 22:54pm
v2
Comments
Abdul Quader Mamun at 9-Aug-12 3:52am
   
Is this required only like you have coded in Style Tag?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
you can do with CSS class like,
 
<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
  Permalink  
Comments
Chiranthaka Sampath at 9-Aug-12 4:11am
   
Can't I do this as the following
 
<pre>
<style type="text/css"
input [type="text] {background-color: red}
</style>
</pre>
 
<body>
 
Address: <input type="text" />
 
</body>
@amitgajjar at 9-Aug-12 4:20am
   
input[type="text"]
{
background-color:yellow;
}
 
you missed quotation mark after type="text(" is missing)
Abdul Quader Mamun at 9-Aug-12 18:25pm
   
good work!
@amitgajjar at 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)

  Print Answers RSS
0 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 255
2 Maciej Los 250
3 Shweta N Mishra 216
4 PIEBALDconsult 174
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,665


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 9 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100