astralaaron Posted April 20, 2007 Share Posted April 20, 2007 Can you add CSS styles to input text / textareas? if so how!thanks! Link to comment Share on other sites More sharing options...
murfitUK Posted April 20, 2007 Share Posted April 20, 2007 Yes, just put this in your CSS. This example shows how can have different styles for the different input types (text, select, button).input.textual { background-color: #e6ac73; color: #406480; border: 1px solid #ffffff; padding: 3px; font-size: 100%; font-weight: bold; }select.dropdown { background-color: #e6ac73; color: #406480; border: 1px solid #ffffff; padding: 3px; font-size: 100%; font-weight: bold; }textarea { background-color: #e6ac73; color: #406480; border: 1px solid #ffffff; padding: 3px; font-size: 100%; font-weight: bold; }input.button { background-color: #e6ac73; color: #406480; padding: 3px; font-size: 100%; font-weight: bold; }input.check { background-color: #e6ac73; border: 1px solid #ffffff; padding: 3px; font-size: 100%; font-weight: bold; }Then your html will be something like:<input type="text" name="name" class="textual"> for a line of text<input type="checkbox" name="name" class="check"> for a checkbox<input type="submit" name="name" class="button"> for a button<textarea name="name">bbbb</textarea> (don't need to do a class because textarea is defined in the cssand for the drop down list:<select name="name" class="dropdown"> <option value="value">text bit here</option>..</select>You can leave out the class and just have one defined if you want all your inputs to look the same:input { background-color: # etc;}and then you only need your html<input type="text" name="name"> without having to declare the class. Link to comment Share on other sites More sharing options...
astralaaron Posted April 20, 2007 Author Share Posted April 20, 2007 Yes, just put this in your CSS. This example shows how can have different styles for the different input types (text, select, button).input.textual { background-color: #e6ac73; color: #406480; border: 1px solid #ffffff; padding: 3px; font-size: 100%; font-weight: bold; }select.dropdown { background-color: #e6ac73; color: #406480; border: 1px solid #ffffff; padding: 3px; font-size: 100%; font-weight: bold; }textarea { background-color: #e6ac73; color: #406480; border: 1px solid #ffffff; padding: 3px; font-size: 100%; font-weight: bold; }input.button { background-color: #e6ac73; color: #406480; padding: 3px; font-size: 100%; font-weight: bold; }input.check { background-color: #e6ac73; border: 1px solid #ffffff; padding: 3px; font-size: 100%; font-weight: bold; }Then your html will be something like:<input type="text" name="name" class="textual"> for a line of text<input type="checkbox" name="name" class="check"> for a checkbox<input type="submit" name="name" class="button"> for a button<textarea name="name">bbbb</textarea> (don't need to do a class because textarea is defined in the cssand for the drop down list:<select name="name" class="dropdown"> <option value="value">text bit here</option>..</select>You can leave out the class and just have one defined if you want all your inputs to look the same:input { background-color: # etc;}and then you only need your html<input type="text" name="name"> without having to declare the class.hey thanks buddy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now