Click here to Skip to main content
11,640,907 members (67,792 online)
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 21:46pm
Edited 8-Aug-12 21: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 Mika Wendelius 380
1 OriginalGriff 205
2 DamithSL 203
3 Afzaal Ahmad Zeeshan 129
4 CPallini 125
0 Mika Wendelius 380
1 OriginalGriff 205
2 DamithSL 203
3 CPallini 125
4 Afzaal Ahmad Zeeshan 89


Advertise | Privacy | Mobile
Web01 | 2.8.150731.1 | Last Updated 9 Aug 2012
Copyright © CodeProject, 1999-2015
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