iGuest 3 Report post Posted October 16, 2007 There are two ways to do this. The first is the 'proper' syntax - the second requires a new class:<STYLE type="text/css">input[type=text] {width: 300px;background-color: cyan;}input.text {width: 300px;background-color: yellow;}</STYLE><FORM><input type="text"><br><input class="text" type="text"><br><input type="text"><br><input type="submit"></FORM> Share this post Link to post Share on other sites
TavoxPeru 0 Report post Posted November 17, 2007 There are two ways to do this. The first is the 'proper' syntax - the second requires a new class:<STYLE type="text/css">input[type=text] {width: 300px;background-color: cyan;}input.text {width: 300px;background-color: yellow;}</STYLE><FORM><input type="text"><br><input class="text" type="text"><br><input type="text"><br><input type="submit"></FORM>Excellent info thanks, what about styling the button of the FILE input field??? is there a way to change for example the color and background color of this input field???Best regards, Share this post Link to post Share on other sites
iGuest 3 Report post Posted October 29, 2009 To specify an element with only certain attributes set, use this: exampletag[exampleattrib=examplevalue] For example, a paragraph with the height set to 300 will have a red background: p[height=300] { background: #ff0000; } <p height="300">This should have a red background.</p> Hope I helped Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 17, 2009 Regarding cssCss For Input Text OnlyI was implementing a report for my bulk sms gateway and I found thisArticle which helped me to give a new look and feel for the interface.-reply by Thomas Share this post Link to post Share on other sites
iGuest 3 Report post Posted February 4, 2010 Bad practice for CSSCss For Input Text OnlyTypically, you do not want inline CSS. This avoids the point of CSS and logical separation from mark up and styles. -reply by Mike Share this post Link to post Share on other sites
iGuest 3 Report post Posted September 28, 2010 I know I'm resurrecting an old post, but this really bugged me "Well, I always try to avoid as much class and id as I can since alongThe way when we writing code, once in a while I will forget to put these attribute in. Even though I will eventually figure out where in my code I missed, it's still better to have a "global" setting which will makes sure consistency for me. " Hopefully in the past few years you've figured out to not be so lazy with your learning. You're making your code more complex than it needs to be by not adhering to web standards simply because you're forgetful. I know this was 5 years ago, but I just needed to throw that out there. Share this post Link to post Share on other sites