| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Text Fields
Hi all,
I have created a new website but I am struggling with certain design elements. The problem that I am having is that the text field that I have used just looks naff! So my question is how do you change the look and feel of such items, so that the they are not the default fields? |
|
#2
|
||||
|
||||
|
Hi,
you can use the style tag try this: Code:
<input style=" background-color:#33FFFF; border: 2;" type="text" name"textField"/> hope this helps
__________________
Look! Its a ShemZilla ![]() ![]()
|
|
#3
|
|||
|
|||
|
Thats cool, thanks!
|
|
#4
|
||||
|
||||
|
no problem
![]() |
|
#5
|
||||
|
||||
|
|
|
#6
|
||||
|
||||
|
It's always your choice, but if I were you, I'd learn the oncoming web standard - use classes and ID's to identify your style.
Between your <head> tags: Code:
<style type="text/css">
#textbox {
background-color: #3FF;
border: 2px;
}
</style>
In the body section of your document: Code:
<form method="post"> <input id="textbox" type="text"> </form> |
|
#7
|
||||
|
||||
|
Not to step on your toes baseballdude_ but if we're gonna tlka standards, the code should be this:
Quote:
|
|
#8
|
||||
|
||||
|
And to take things one step further
ID's must be unique on the page. It is very likely that you would have more than a single input in a form, and if you styled each one by ID you would have to write the CSS for each ID in the style declaration. When styling repeated elements it is advisable to style the elements by class, or place them in a container that is styled by ID. The elements inside the container are then styled by cascaded style declarations. An example may be: Code:
<style type="text/css">
#contactForm {
margin: 0;
padding: 0;
}
#contactForm input, #contactForm textarea {
background-color: #3FF;
border: 1px solid #000;
padding: 0.3em;
}
</style>
Code:
<form name="contactForm" id="contactForm" method="post">
<label for="yourname">Your Name:</label>
<input type="text" name="yourname" id="yourname" /><br />
<label for="yourphone">Your Phone No:</label>
<input type="text" name="yourphone" id="yourphone" />
</form>
__________________
-
thought-after | my thoughts on web development Get Firefox, the developers browser Budget hosting - recommended [/left] |
|
#9
|
||||
|
||||
|
Quote:
Very true, gotta step on my toes, don't ya? |
![]() |
| Viewing: ASP Free Forums > Web Design > Web Layout > Text Fields |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|