Click here to Skip to main content
13,052,956 members (62,062 online)
Rate this:
Please Sign up or sign in to 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!


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

1 solution

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

Solution 1


you can do with CSS class like,

<style type="text/css">
.textbox { background-color:#00BFFF; }
<input type="text" class="textbox" id="your_id" title="YourTitle" />

Hope this way will help you,

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

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



Address: <input type="text" />

@amitgajjar 9-Aug-12 4:20am

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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 9 Aug 2012
Copyright © CodeProject, 1999-2017
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